FORUMS
Remove All Ads from XDA

[TUT] How to set Icon for your Android Apps

1,988 posts
Thanks Meter: 1,067
 
Post Reply Email Thread
Hi guys, this is just a simple Tutorial to setup your own icon for your Android applications.


- So, first you have to create/find a 48 x 48 PNG image and place the image inside your Project folder under res/drawable. You can name the icon as of your choice, but remember to use same name in every folders like drawable-hdpi or drawable-mdpi etc..

- Open AndroidManifest.xml

- Inside the XML file, you should see an <application> tag, and the android:icon attribute. Add the below line to that attribute.

Code:
android:icon="@drawable/icon"
Note that, I named my icon as icon.png since the name icon. PNG extension is not needed in the XML file. Just only have to specify the icon name.

So, now you have successfully set your icon to your app.

But the thing is, Android Phones comes in variety of Screen resolutions. So your app icon must also support the different screen sizes/resolution. For this, inside your Project you will find many folders like drawable-hdpi, drawable-ldpi, drawable-mdpi and drawable-xhdpi under the /res folder. Add those images inside the respected folders by the resolution specified in the below table.


Quote:

1. Low Density (~120dpi)

  • Folder Path: res/drawable-ldpi
  • Image resolution must be 36 x 36 PNG file.

2. Medium Density (~160dpi)
  • Folder Path: res/drawable-mdpi
  • Image resolution must be 48 x 48 PNG file.

3. High Density (~240dpi)
  • Folder Path: res/drawable-hdpi
  • Image resolution must be 72 x 72 PNG file.

4. Extra High Density (~320dpi)
  • Folder Path: res/drawable-xhdpi
  • Image resolution must be 96 x 96 PNG file.


Anyways as an example, I have set an icon for this Application, and the before/after setting the icon is showed in the below pics.


BEFORE :


AFTER :



So, that's it. And its not that hard thing to set an icon for your Android apps. I have used XDA logo of various resolutions for the icon. You can download the one's I used from here, or you can design your own and set as mentioned in the Tutorial. Also, you may need to check the Icon Design Guidelines specified by Google for reference.
The Following 3 Users Say Thank You to coolsandie For This Useful Post: [ View ] Gift coolsandie Ad-Free
 
 
8th July 2012, 01:28 PM |#2  
coolsandie's Avatar
OP Senior Member
Flag Kochi, Kerala
Thanks Meter: 1,067
 
More
Reserved.
Post Reply Subscribe to Thread

Tags
android, app, development, icon, setting
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes