Customizing Launch Icon On Eclipse/PhoneGap Application

OK, here’s another quick tip.  If you’re ready to replace the default icon on your Android application in Eclipse, it’s just a matter of placing your icon images in the “/res” folder.  By default, an icon named “ic_launcher.png” is used, so you can just replace those files with ones of your own creation and voila!  If you want to preserve those default icons and add your own, just place them side by side with “ic_launcher.png“.  A few considerations:

  • You’ll need a set of 4 icons at different resolutions in the format PNG.  They all should have the same name (you’ll see why in a minute).  I created my icon images at the following sizes: 36 x 36 pixels, 48 x 48 pixels, 72 x 72 pixels, and 96 x 96 pixels.  This corresponds to the four sizes supported by Android: Low DPI (ldpi), medium DPI (mdpi), high DPI (hdpi), and extra-high DPI (xhdpi).
  • Once you have your icon files ready, copy them to the project’s folder “/res/drawable-xxxx“, where “xxxx” is the resolution of the icon file (i.e. ldpi, mdpi, hdpi, or xhdpi).  See figure 1.- Figure 1 –
  • Optional: If you chose to use a different name from the default, like I did, you’ll have to change the icon configuration in your “AndroidManifest.xml” file.  Just double click the file and locate the line that reads “android:icon=@drawable/ic_launcher” and change it to “android:icon=@drawable/xxxx“, where “xxxx” is the name of your icon file without the extension (see figure 2).  Note: you can also do this in the Application tab available in the editor when you double click your file (see figure 3).- Figure 2 –

    – Figure 3 –

And that’s it! Hope this helps.

One thought on “Customizing Launch Icon On Eclipse/PhoneGap Application

Leave a comment