If you have an EditText on your Activity layout, you might encounter on real devices, that the soft keyboard annoyingly shows up.
The easiest solution to hide it, is to set soft input mode in Activity.onCreate method:
The fastest Singleton design pattern implementation by Bill Pugh:
public class Singleton
private static class SingletonHolder
private final static Singleton INSTANCE = new Singleton();
public static Singleton getInstance()
If you want a realistic, nice shadow around an image in an ImageView you might configure it with the following layout:
Source with shadow image: Stackoverflow.com
Note This solution works best with fitXY scaleType, it does not apply to aspect corrected images. (it can be done with custom Drawable object)
Although this kind of list refreshing is rather an iPhone feature, and not really used on Android platform, sometimes it is requested to use.
An easy to use listener-based implementation can be found here by Johan Nilsson.
Alternative version thanks to Guille Polito.
Update here is another lib, used in Friendcaster and co: Android-PullToRefresh by Chris Banes
Disabling Edittext item in Android is not straightforward, because the setDisabled method does allow text input by user.
To prevent user editing use one of the followings:
Here is the Android code for converting a View object to Bitmap without displaying it. This can be useful for displaying complex views in a Gallery widget.
Bitmap bmp = Bitmap.createBitmap(Utils.getPixelForDp(width, this), Utils.getPixelForDp(height, this), Bitmap.Config.ARGB_8888);
View v = getLayoutInflater().inflate(layoutid, null);
v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
Best source: Stackoverflow.com
Sometimes GPS coordinates for locations aren’t stored in databases, in this case another servers should be used to determine the latitude/longitude of an object. Fortunately there are ready solutions for this problem via Geocoding.
Geocoding on iOS
Geocoding on Android
Signing an Android application, is not too complicated, however could be tricky, and it is always good to have a quick summarizer tutorial about it:
The new Android plugin for Eclipse is now available (v8.0.1), and it fixes many bugs, and also became compatible with Eclipse Helios.
More informations here: ADT Plugin for Eclipse
A good review about the the updated plugin can be found here.
Very useful example about creating a coverflow widget using the Gallery component provided by the framework:
If you wish to know more about the Gallery widget, here is a good tutorial with examples:
An older version of the widget can be found here, however this is much more complicated…