android

How to programmatically read the date when my Android apk was built?

Is it possible to programmatially read the date when my Android apk was built? I could not find anything in the PackageInfo class. I want to expire beta versions of my app and the easiest way would be to read out such a date and expire it after a fix preiode of days, so I don't have to update the code for that eavery time I build and de...

Is it possible to run linux on hand-held tablets?

I want to run a django app on a hand-held device. It'll need to run Python (obviously) and will write its data to an SQLite database. Are there any tablets available that will let me do this? Specifically, if I bought an Android tablet, would I have to/be able to install linux instead, or would I be able to run it under Android? ...

Can't install Android ADT in Eclipse

Help! With Windows 7, Galileo, Eclipse 3.5.2: every time I click Finish when installing ADT I get the error "Install has encountered a problem - an error occurred while uninstalling". Details: String index out of range:0 eclipse.buildId=unknown java.version=1.6.0_21 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARC...

Reusing Android's MediaPlayer

Hi! I'm using the Android's MediaPlayer class to play some remote resources. I would like the user to be able to reuse the MediaPlayer to open some content and then change it to play another one without having to recreate the MediaPlayer. So, I wrote a method to open a resource which, first of all, resets the MediaPlayer so that I can s...

Handling Android hardware Back button

I have an onKeyDown event which is only needed for handling the Up and Down hardware keys in my app. For these it returns true, as they are handled. For anything else it returns false which I understand means that the OS should handle them. However, when I press the Back button, my onKeyDown is called and returns false, but there is no o...

AndroidManifest.xml; unable to include external library

I'm following the MapView tutorial on the Android website [2010-08-22 11:12:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestParser] Parser exception for /MeCercana/AndroidManifest.xml: Open quote is expected for attribute "android:name" associated with an element type "uses-library". [2010-08-22 11:12:24 - MeCercana] ...

Release several android applications with same code base

Hi: I want to release multiple applications to android marketplace which are all very slightly customized based on a code base. I can't just change the package indentifier in the AndroidManifest.xml file because several other things dependet on this like action identifiers and so on. What is the best approach to release several apps base...

accessing a class from another activity

Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs class - extends PreferenceActivity and implements OnSharedPreferenceChangeListener MainActivity creates a MyLayout class and sets it as its contentview. Once the user presses on the menu, Prefs class starts where the user can change some s...

Android mediaplayer error playing mp3 stream after a long pause

Devices: Android 1.5 on HTC Hero, and emulator 1.5 I am using Mediaplayer to play a stream...this works fine however when it is paused for a while and then resumes it periodically has an error. Searching for the error codes on the internet yield very few results. 08-22 12:18:47.461: ERROR/MediaPlayer(4406): error (1, -18) 08-22 12:18...

Android: Widget updating a clock with custom images as numbers

What way is most efficient for updating an widget that will be a clock(Timer/Alarm), but for a clock to really works, like a clock it would be needed to update at least twice in a minute (30 sec period or less). But that can't be effective? Have looked at some of the "threads/topics" here at StackOverFlow but haven't found any informat...

Updating camera overlay using sensor/gps information

I'm writing an Android application that takes information from orientation sensor and gps and overlays information over a camera preview. I can create and view the camera preview fine using a SurfaceView and I can create an overlay using a separate View to display additional data, using invalidate() to update the overlay when sensor dat...

Debug android application

I am developing an Android application where I get the exception while writing to the database: An exception occurred: android.database.sqlite.SQLiteException But it doest say anything else. In general I find it very difficult to debug the exceptions. I am using Eclipse to develop the application. Please help me in solving this issue.....

Android : LocationManager dynamically adjust minTime/minDistance thresholds

This is the way I listen for GPS location updates (using LocationManager and a LocationListener): locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); listener = new MyLocationistener(); // LocationListener locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 30000, // milliseconds (m...

Connecting my Android service with the db

Hi i'm working on a service that collect data from sensor and save a fast fourier trasform in to the db, but when i press the red phone button (to make the screen black) it don't save anything. Any idea? In addition i noticed that when i stop the service, it continues to read sensors, how should I do? This is the code that i use to con...

Issue on setOnclickListener

I have two buttons set, "OK" and "Cancel" in main.xml. I have setOnclickListener for the Cancel. When I click on OK i need another xml file say abc.xml to get displayed. I have added that xml file under the layout folder. How do I do this? ...

Android count size of INT Array

Hi, I have an Array like: private static int[] f_arme = { R.drawable.frankiearmevor_0001, R.drawable.frankiearmevor_0002, R.drawable.frankiearmevor_0003, R.drawable.frankiearmevor_0004, R.drawable.frankiearmevor_0005 } how Do I get the Size of that array (f_arme) ?? = 5 I tried f_arme.size() but get "can...

How do I get the text from a context menu?

I have a ListActivity with a list of names (Jacob, Will, Matt, etc.). I have a contextMenu which gives the user the option to edit or delete the person. I know how to find the id to perform the edit and delete functionality, but I can't figure out how to get the person's name to be added to the intent extras or to add a toast when a de...

Keeping an AsyncTask alive in low memory conditions?

I have written a home screen widget as an ImageView, ie. the code generates the whole widget and writes it to RemoteViews as a bitmap. On slower devices with low memory, such as my G1, it can take a couple of seconds to generate the bitmap, and to avoid the dreaded force-close, I moved all the graphics code into an AsyncTask. So far so g...

Positioning a badge bubble on the left upper side of a button

I am trying to add a badge to one of my Activity's button. Right now I am trying to do the xml. The Button with the badge, should look like this: I have already done the bubble and the text inside using a RelativeLayout: <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> ...

Dynamic preferences for a variable number of profiles in an Android app

Hi, I am looking for a way to create dynamic preferences where I don't need to hard code the preference key and I could have a variable number of preferences. Basically, my application will let the user create a multiple number of profiles and each of these profiles will save custom values for a fixed number of preferences. So this w...