RSS

Android changing the icon

04 Jul

By default the icon set for any app (if left unspecified) is:

We’ll if you got something like:

Go to the android manifest – this is where all the stuff are defined, like which file starts first then which and it also happens to define our icon too.

Look for:

<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

As you can see the icon is set to ic_launcher. The ‘drawable’ defines the folder that it is in. Your images are set in the drawable folder. So you have two options: You can either set the name of the icon you want to ic_launcher, and go and replace the default icon with yours(thats what I did) or you can change the reference like:

<application
        android:icon="@drawable/my_icon" // the icon's name is my_icon
        android:label="@string/app_name" >

and set it in the drawable folder.
Incase you are wondering why there are 3 drawable folders, there is a good reason for that. There is a wide range of android phones some with high density screens, medium upto low. There is a great read at the Developers page, check it out. Basically you’d want to replace your icon in all the drawable(hdpi, mdpi, ldpi) folders so that it supports all phones.
There other thing is use .png format images, it may or may not work when you have .jpeg or .jpg so just to be safe .png.

Advertisements
 
Leave a comment

Posted by on July 4, 2012 in Android

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: