Android application icon tutorial

Assigning an icon to your Android application just takes a minute.  Actually creating the icon may take a bit longer. :P

  1. Create a 48×48 PNG and drop it into /res/drawable.  The name of this file is usually “icon.png”.
  2. Open your AndroidManifest.xml.
  3. Right under the root “manifest” node of the XML, you should see the “application” node.  Add this attribute to “application”. (The “icon” in “@drawable/icon” refers to the file name of the icon.)
    android:icon="@drawable/icon"

Your app is now iconned.

To support multiple resolutions, you can create icons of different resolutions and place them in the correct folders.

  • Low density
    • res/drawable-ldpi
    • 36×36 resolution
  • Medium density
    • res/drawable-mdpi
    • 48×48 resolution
  • High density
    • res/drawable-hdpi
    • 72×72 resolution
  • Extra high density
    • res/drawable-xhdpi
    • 96×96 resolution
Posted in Android by Connor Garvey at January 31st, 2009.
Tags: , ,

37 Responses to “Android application icon tutorial”

  1. Ernest says:

    Something I was wondering for myself and might help someone

    If you support multiple devices and thus have multiple icon resolutions in multiple folder, the definition in androidmanifest.xml stays the same “@drawable/icon”

  2. mehdi says:

    Thanks, Works fine

  3. Niels says:

    Thanks!

  4. Jordi says:

    The simplicity of great things ;-)) Thanks for saving me of any investigation!

  5. Frank says:

    Question:
    I want to create a custom icon for the home that would launch a website or web app; not a downloaded and installed app. Is there a way to do that?

    Thanks!
    Frank

  6. GaelleMG says:

    Thank you!! Just what I was looking for ;o)

  7. Nazrul Amin says:

    Mate, your a life saver!

  8. debaprasad says:

    ur page has saved ny job today…

  9. uthir says:

    simple and best
    thanks for the post

  10. [...] Connor Garvey at January 31st, 2009. Tags: Android, icon, mobile Referenced by: http://www.connorgarvey.com/blog/?p=97 Like this:LikeBe the first to like this [...]

  11. oegidio says:

    Excelente, muchas gracias por su conocimiento y tiempo.

  12. Shashank says:

    Thanks that helped me a lot…

  13. lendski says:

    thank you!!!

  14. Soniya says:

    thanks. it helped me.

  15. Kiran says:

    Thank you for the info. Quick and Simple.

  16. arun says:

    Thanks. Really helpful

  17. Vishnu says:

    That’s a nice tip! Thanks!

  18. 72×72 @ /res/drawable-hdpi
    48×48 @ /res/drawable-mdpi
    36×36 @ /res/drawable-ldpi

  19. Ubudog says:

    Thanks for this! Really helped!

  20. Minal says:

    That was great! thanks a lot.

  21. Mukesh says:

    nice article

  22. BigG says:

    Thanks. Nice one :)

  23. Thanks for the info! You can save the “icon.png” also to “res/drawable-nodpi”.

  24. Markus Greve says:

    In current Android SDK the icon files are located in /res/drawable-*.
    There are subfolders for the following sizes:

    /res/drawable-hdpi/icon.png ….. 72×72
    /res/drawable-mdpi/icon.png …. 48×48
    /res/drawable-ldpi/icon.png …… 36×36

  25. Flavio says:

    I Im working with a Motorola DEXT with a 1.5 api, and the icon it’s not shown. When I use an emulator with a 1.6 or newer api it works just fine. Is there any additional steps to configure the icon for older apis like the 1.5 I’m working on?

    Thank you very much

    • MrSqueezles says:

      Hi Flavio.

      That’s strange. Newer versions of Android support low, medium and high res icons. Older ones don’t. Be sure to place the icon right in the drawable folder.

  26. NA says:

    Where is the folder on the Droid X? Can it be viewed with Astro?

    • MrSqueezles says:

      The folder is in the application package. I don’t think there’s a way to view it once it’s installed. You may have access if your phone is rooted, but I don’t know about that at all.

  27. MV says:

    This was the most helpful page I found to do this, simple and quick! Thanks!

  28. initdotd says:

    easy to follow. thnx!

  29. m says:

    yea good tip man !

  30. shyamala says:

    Thanks this was really helpful

    • erik says:

      hi
      what about nine-patch images.
      Can they be used instead of the ?

      /res/drawable-hdpi/icon.png ….. 72×72
      /res/drawable-mdpi/icon.png …. 48×48
      /res/drawable-ldpi/icon.png …… 36×36

Leave a Reply