1. Prepare the Icons
You need to create a set of icons with different resolutions and dimensions to suit with different types of phone displays. Android developer website provides a set of template icons, that you can use to start designing your icons. They are photoshop files with .ps extensions. You can also use free tools like GIMP to open these template files and modify them, or you can create the icon images from the scratch.
Here are the specified dimension (width x height) and the resolution (dpi) of the icon for different types of displays.
- Low density screens (ldpi): 36x36px, 120dpi
- Medium density screens (mdpi): 48x48px, 160dpi
- High density screens (hdpi): 72x72px, 240dpi
- Extra high density screens (xdpi): 96x96px, 320dpi
Here is the set of icons I prepared for the BMI Calculator app.
Open the 'res' directory in your project and copy the icons into the corresponding sub directories listed heer.
- Low density screen icon : res/drawable-ldpi
- Medium density screen icon : res/drawable-mdpi
- High density screen icon : res/drawable-hdpi
- Extra high density screen icon : res/drawable-xdpi
That's it. If you put the icons in the correct directory with the correct name, the android development kit will pick them and use for the launcher icon of you app.
2. Test the launcher icon in your phone
Check reinstalling the app on your phone. (You can redo the step5 mentioned in the previous blog (Writing Your First Android App - Body Mass Index Calculator) to reinstall the app on your phone. Click the app drawer and see how well the icon of your app goes with other apps.
|Download the eclipse project files (zipped)||com.blogger.android.meda.bmicalculator-updated.zip|
|Access the Source code from github||github repo|
|Download the free BMI Calculator app (the latest version) from the Android Market.|