android

how to run Android emulator automatically from eclipse?

may i know how to auto run a project on Android emulator using eclipse? ...

How to ship an Android application with a database?

If your application requires a database, and comes with builtin data, what is the best way to ship that application? 1) Precreate the sqlite database and include it in the apk? 2) Include the SQL commands with the application and have it create the database and insert the data on first use? The drawbacks I see with 1): possible sqlite...

When you get a stack trace in Eclipse with SDK classes in the stack, how can you see the SDK sources?

When you are developing an Android application with the Eclipse plugin and debugger, and get a stack trace, you will not see any of the SDK source code. What steps do you need to make to fix this? Assume beginner Java programmer. To clarify, I want Eclipse to automatically show me the correct source files and lines when I jump into a st...

Best practices for unit testing Android apps

I'd like to unit test my Android application but I found that test driven development in Android is far from trivial at the moment. Any tips, tricks, war stories for building light weight and preferably fast running tests? ...

Android TextView Timer

For my Android application there is a timer that measures how much time has passed. Ever 100 milliseconds I update my TextView with some text like "Score: 10 Time: 100.10 seconds". But, I find the TextView only updates the first few times. The application is still very responsive, but the label will not update. I tried to call .invalidat...

Is there a view for inputing integers in Android?

I'm looking for something like the individual parts of the date picker dialog. A view that allows you to input integers (and only integers) that you can limit (between 1 and 10 for example), where you can use the keyboard or the arrows in the view itself. Does it exists? It is for a dialog. A ready-made dialog to request an integer woul...

Best option for using the GData APIs on Android?

What's the least painful and most size efficient way to use the Google Data APIs in an Android application? After a few quick searches t seems that there is an android-gdata project on Google Code that seems to be the work of a single author. I didn't find any documentation for it and don't even know if it's production ready yet. An ol...

Android Respond To URL in Intent

I want my intent to be launched when the user goes to a certain url: for example, the android market does this with http://market.android.com/ urls. so does youtube. I want mine to do that too. If anybody could explain this, thank you very much. Isaac Waller ...

Android Download Intent

Hello, I was wondering what is the intent for downloading URLs? In the browser, it will download stuff with a little notification icon. I was wondering if I can use that intent (and what it is). Thanks, Isaac Waller ...

Android Activity with no GUI

Hello, I have created a activity that is only meant to be launched from a link (using a intent filter.) I do not want this activity to have a GUI - I just want it to start a service and put a notification in the bar. I have tried to put the intent filter for the link in my service, but that does not work. Is there a better thing to do th...

Android - Get time of chronometer widget

I have a Chronometer widget in my Android app. I was wondering how to get the time from it. I tried getText, getFormat, getBase, etc, but none of them work. This is probably a easy question, but I could not find it on Google. Thanks, Isaac Waller Example code snippet: Chronometer t = (Chronometer)findViewById(R.id.toptime); long time =...

How to remove a contact programmatically in android

I try the following code to remove contact with a specified number: private void removeContact(Context context, String phone) { //context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, phone, null); context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, Contacts.PhonesColumns.NUMBER+"=?", new String...

Android TouchEvents DOM API

Is there a TouchEvents DOM API for Android? I need to implement drag & drop behavior. ...

Android : Location.distanceTo not working correctly?

I am having an issue calculating distance using the Location.distanceTo method. private class MyLocationOverlay1 extends MyLocationOverlay { @Override public void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) super.drawMyLocation(canvas,mapView,lastFix,myLocation,wh...

How do I display the current value of an Android Preference in the Preference summary?

This must come up very often. When the user is editing preferences in an Android app, I'd like them to be able to see the currently set value of the preference in the Preference summary. Example: if I have a Preference setting for "Discard old messages" that specifies the number of days after which messages need to be cleaned up. In th...

How to size Android components according to image size using XML

Hi I have created a custom icon bar in Android using the XML layout creator, using a RadioGroup within a LinearLayout (XML included below). Each RadioButton within the RadioGroup has a custom drawable (with checked and unchecked states) as its android:button attribute. The Linear layout is itself within a RelativeLayout so that it c...

Android : BaseAdapter how to?

Ok, I have been searching thick and thin, and I am having some issues implementing a BaseAdapter. I have been able to implement a Simple Cursor Adapter http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/view/List7.html as per the example above. There is a pretty good BaseAdapter example here : List14 google e...

Android - How do I do a lazy load of images in ListView

Hi I am using a ListView to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load the images so while the text displays, the UI is not locked up and images are displayed as they are downloaded. The number of images is not fixed. Thanks. ...

Tips for optimizing a website for Android's browser?

I'm looking for tips, tricks and resources on optimizing a website design for Android's browser. I'm building an Android app and some of the functionality will be accessible through a web interface. ...

Line-breaking widget layout for Android

I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As space required for all 'words' in a 'sentence' would exceed the available horizontal spac...