android

Quitting an application - is that frowned upon?

Moving on in my attempt to learn Android I just read the following: Question: Does the user have a choice to kill the application unless we put a menu option in to kill it? If no such option exists, how does the user terminate the application? Answert (Romain Guy): The user doesn't, the system handles this automatically. That's what...

Streaming with Android MediaPlayer - catching errors and buffering

I'm having trouble getting MediaPlayer to be resiliant when streaming from a HTTP URL. If I start playing the file, but then drop the connection (e.g. airplane mode), MediaPlayer#OnErrorListener generates what=1, extra=-17; and then shortly afterwards what=-38, extra=0. There's no documentation I can see in the APIs of what this denotes...

Where'd the Link Go to Upgrade G1 Dev Phone to 1.6

So, this HTC site is supposed to have links to update the g1 dev phones (and I've used it before). http://www.htc.com/www/support/android/adp.html Now, it seems like the update links are no longer there - Anyone know what's going on, or where I can get 1.6? Thanks! Jeff ...

enabling drag and drop on a touchscreen mobile device

Hello all, I just recently got an android phone and found that the drag and drop on my site doesn't work! I understand why it wouldn't, but has anyone found a solution to this? I'm using JQuery to implement the D & D... ...

Android sqlite sort on calculated column (co-ordinates distance)

I am using an SQLITE database to store latitudes and longitudes of locations. I want to be able to sort the results by rough distance from the current location. I already have the current location of the device as a double (lat, lng), the lat and lng in the database are also doubles. What I want is a query that will create a virtual co...

Android OpenGL ES Transparent Background

I'm building an Android app that takes advantage of OpenGL. As it stands, the background for the GLSurfaceView is dynamically generated by my code and loaded in as a texture and drawn with glDrawTexfOES. Which is "ok", but I can simply display the image much more smoothly to its own surface (without OpenGL). Is there any way that I can m...

Read txt file in res/raw/ within Android NDK

I have a file within my application that I want to have included within the .apk for my android app that is a .txt file. My application is almost entirely written in C through the use of the NDK, using OpenGL as well. I know I can bundle the txt file by placing it in /res/raw/, but is there anyway I can access this within the android N...

How do I allow a user to browse/choose a file for my app use in Android?

I have an app where the user can choose a profile pic using images stored on the phone or SD. Do I have to write my own file explorer for this? I've seen a couple examples on anddev, but wasn't sure if there is another way. Thanks. ...

Distribution of Android application

Hi, I'm in the process of researching if and how an entrerprise Windows Mobile .NET application can be ported to Android. The question that I'm into right now is how to distribute and update the application once it's developed. The current .NET application is "installed" on a device using an approperiate system image. The program then u...

How to call "isInitialStickyBroadcast()" and avoid problems on 1.6 ?

isInitialStickyBroadcast() is obviously only available after 2.0 (SDK 5) I'm getting this error: "Uncaught handler: thread main exiting due to uncaught exception java.lang.VerifyError" It's only happening on 1.6. Android 2.0 and up doesn't have any problems, but that's the main point of all. I Can't catch the Error/Exception (java.lang...

AsyncTask and SQLite Database

What's the best way to access the database through an async task? I don't think I should pass in a reference to the DbAdapter that the activity is using (could be closed as the activity may be garbage collected). Also, the db needs a context to be opened and closed, but I don't have that with the asynctask. ...

appWidget Orientation Code

I have code in an appwidget that I want to run when the phone's orientation changes on the home screen, ie like when the keyboard flips out. I have an image that I want to change in an imageview in my appwidget. I can't use different layouts linked to the orientation (ie "layout" and "layout-land") because I don't know the name of the im...

How to create many lists on Android?

Hello Guys, sorry for this dumb question, but i am really stuck... the thing is i am trying to create a todo list application on android. I am stuck because at the moment I dont know the way to create many todo lists. I have created the GUI for one list, using listview. entries of the list are added by the user when running the appli...

Gallery item width vs gallery width

I have a Gallery with a set of images that was downloaded at run time. I followed the example here: http://www.anddev.org/a_androidwidgetgallery_-_example-t332.html but instead of using i.setImageResource(this.myImageIds[position]); I used i.setImageBitmap(bitmaps.get(position)); This doesn't fill the entire width of the screen...

Camera Preview on Motorola Droid

Our application displays a camera preview and it seems to work fine on all phones except for the Motorola Droid where we get a runtime exception when we set the camera parameters: java.lang.RuntimeException: setParameters failed at android.hardware.Camera.native_setParameters(Native Method) at android.hardware.Camera.setParame...

List of Open Source projects that aid Android app development

A lot of open source libraries that aid in Android application development have sprung up with time. IMO looking at source code of good projects helps learn the system better, faster and not to mention reduces development time. Is there a recommended list of such projects or if not, can we build such a list? I think it will really be use...

Best practices combining list and non-list views, like the Market

I'm trying to tackle a problem that seemingly many Android developers have, which is how to intersperse lists with non-list data, in one big scrollable pane. The model I have in mind is the screen for an individual app in the Market. You have a big description, a list of a few lazily loaded comments, and then some individual items tha...

How to read a text file via FTP

I am creating an application for the android, and would like it to be able to read a text file via anonymous FTP. I've tried URLConnection, but it doesn't seam to be working. After some Google searching it appears that URLConnection doesn't always work with some FTP servers. All of the java FTP connection libraries I've found require ...

How to detect when a user taps on a view in Android

I want to detect when a user taps anywhere in a view in my Android application. My code looks like this: linearLayout = (LinearLayout) findViewById(R.id.linearLayout); // main layout // ... linearLayout.setOnTouchListener(this); // ... public boolean onTouch(View v, MotionEvent event) { Toast.makeText(this, "Touch!", 1000); if ...

how to start activity when the main activity is running in background?

Hi, I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen). I tried to enabled it the following way: @Override public void onProductsResponse(Li...