Android application icon tutorial
Saturday, January 31st, 2009 - 9:42 pm - Android
Assigning an icon to your Android application just takes a minute. Actually creating the icon may take a bit longer. 😛
- Create a 48×48 PNG and drop it into /res/drawable. The name of this file is usually “icon.png”.
- Open your AndroidManifest.xml.
- 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
Awesome post, keep it up
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”
Thanks, Works fine
Thanks!
[…] http://www.connorgarvey.com/blog/?p=97 […]
The simplicity of great things ;-)) Thanks for saving me of any investigation!
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
Thank you!! Just what I was looking for ;o)
Mate, your a life saver!
ur page has saved ny job today…
Thanks.
simple and best
thanks for the post
[…] 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 […]
Excelente, muchas gracias por su conocimiento y tiempo.
Thanks that helped me a lot…
thank you!!!
thanks. it helped me.
Thank you for the info. Quick and Simple.
Thanks. Really helpful
That’s a nice tip! Thanks!
72×72 @ /res/drawable-hdpi
48×48 @ /res/drawable-mdpi
36×36 @ /res/drawable-ldpi
Its actually 1X, 1.5X and 2X ratio of the drawable images whenever to use inside the application.
Thanks for this! Really helped!
That was great! thanks a lot.
nice article
Thanks. Nice one 🙂
Thanks for the info! You can save the “icon.png” also to “res/drawable-nodpi”.
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
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
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.
yo thanks man
Where is the folder on the Droid X? Can it be viewed with Astro?
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.
This was the most helpful page I found to do this, simple and quick! Thanks!
easy to follow. thnx!
yea good tip man !
Thanks this was really helpful
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