android

How to make a nice looking ListView filter on Android

I want a nice looking filter for my ListView in Android. How can I do this? ...

Adding rotation angles to exif file

Can anyone help me to get the rotation angles of a htc hero phone in the image exif file while taking a photo? (Android 1.5 plattform) I appreciate your answers. ...

How to determine Android internet connection?

How can I determine the current internet connection type available to an Android device? e.g. have it return WiFi, 3G, none. ...

[Android] Changing LayoutParams programatically has no effect. Why?

I have a custom view, derived from Button, which I want to position at runtime, relative to another view. Because I don't know that other view's position yet when my view is being inflated (because layouting hasn't started), I leverage the onSizeChanged handler to set my view's position relative to the other view. In onSizeChanged: Lay...

shortcut key to launch an app

Hi Is it possible to define a shortcut key to launch the app I'm developing for android? Can a service running in the background get hardware button events like the camera or send button for example. Thanks ...

(Android) How to fill elements in an Android ListView programmatically ?

Hi there, I have a ListView with an adapter extending BaseAdapter. I create a view (from a LinearLayout and I put some items ont it depending on some parameters. I have a textview, with a drawable and sometime another textview next to the drawable in this horizontal linearlayout. For some reason, this command doesn't seems to work. set...

Android - AsyncTask and error handling

I'm converting my code from using Handler to AsyncTask. The latter is great at what is does - async updates and handling of results in the main UI thread. What's unclear to me is how to handle exceptions if something goes haywire in AsyncTask#doInBackground? The way I do it is to leave error Handler and send message to it. It works fine ...

Android - ListView fling gesture triggers context menu

Hi, I'm relatively new to Android development. I'm developing an app with a ListView. I've followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, it pulls up the context menu for the item. I just want the fling action to be handled in code (my app does one list per date and I want...

Formatting time on Android, while following preferences (24 hr clock vs. AM/PM, etc..)

I'm currently using the following code to format time on Google Android: DateFormat.getDateTimeInstance().format(millis) While this code honors my timezone and locale settings, it ignores the '24 hour mode' setting in system preferences, always returning time in AM/PM. Is there any way to get time in the same format as that on the sta...

View image in ACTION_VIEW intent?

Hi, I'd like to show a png or jpg I downloaded from the next in an image viewer intent, but can't get it to work. Bitmap bmp = getImageBitmap(jpg); String path = getFilesDir().getAbsolutePath() + "/test.png"; File file = new File(path); FileOutputStream fos = new FileOutputStream(file); bmp.compress( CompressFormat.PNG, 100, fos ); ...

Emulator problem in Android

When I launch the emulator I face many problems (Errors):- HttpConnectionApp]emulator-5554 disconnected! Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'! Emulator]emulator: ERROR: the user data image is used by another emulator. aborting Each time I have to re-run it but all in vain. How can I improve this so that I c...

SQLiteOpenHelper.getWriteableDatabase() null pointer exception on Android

I've had fine luck using SQLite with straight, direct SQL in Android, but this is the first time I'm wrapping a DB in a ContentProvider. I keep getting a null pointer exception when calling getWritableDatabase() or getReadableDatabase(). Is this just a stupid mistake I've made with initializations in my code or is there a bigger issue? ...

Can we delete an SMS in Android before it reaches the inbox?

I am deleting an SMS from the inbox but I want to know: How can I delete it before it reaches the inbox? ...

Distinguishing development mode and release mode environment settings on Android

I'm building an Android application and would like to maintain a few environment variables that I can tweak depending on whether I'm in development mode or release mode. For example, I need to invoke a web service and the URL will be slightly different in either mode. I'd like to externalize this and other settings so I can change them ...

Is there any way to have WebView auto-link URLs and phone numbers in Android?

If a page has a URL or a phone number on it that isn't a link is there any way to have WebView recognize it and automatically turn it into a link like you can with TextViews? With a TextView you would simply set the android:autoLink to the desired settings: <TextView android:autoLink="web|phone" ... /> but I can't find any eq...

Android TextView's subscript being cliped off

The Android TextView clips off my text subscripts (see image below) even when I use android:layout_height="wrap_content" for the TextView. Is there a fix/work-around for this? P/S: Superscripts work fine Note: padding doesn't work. I tried even adding a padding of 50dip but it did not help. I can use an absolute height such as 50d...

Android: Callback for an application launch

Is there a way I can be notified of an application launch and termination in Android? I mean, more like subscribing to the Activity Manager and then determining which applications have been started and stopped... ...

How can I layout 2 TextViews (1 on left, 1 on right) and a SeekBar on the same line

Hi, How can I layout 2 TextViews and a SeekBar on the same line in my layout xml file? I know But how can i specify TextView (one on the right, one on the left) to use only the width it needs to display the string in the TextView while SeekBar will use up the rest of the line? And i don't know the text vale of each TextView in the be...

Extend Contacts application on Android to provide encryption

Hi All, I want to encrypt individual contacts stored by the Contacts application on Android based on user's preference. So, I am thinking I'll have to hook/extend the Contacts application before the it stores data into the database and decrypt it when the user wants to view it. Also, I am assuming I will have to store the key for encryp...

Fail to connect to camera service on G1

I apologize in advance for this long post, but it's necessary to show what is happening. I've been working on an app that works on the 1.6 emulator, but bombs on my G1. Here is the Photographer activity: public class Photographer extends Activity { private SurfaceView preview = null; private SurfaceHolder previewHolder = null; pri...