Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App (retired 2014) Sharing Your Creation Adding a Launcher Icon

Rui Silva
Rui Silva
2,540 Points

Different icons on different smartphone

Hi,

I've been building this android app (Crystal Ball), with no problem, but when i get to part where we change the icons, i can't do it.

Well, i've done everything as the videos says, i've tested it on two devices (Galaxy S2 and Nexus 5), and i get two different icons.

On the Galaxy, it always shows the stock icon. On the Nexus 5 i get the example we've created just to show how it works.

Can someone help me please.

Thanks

3 Answers

Gergő Bogdán
Gergő Bogdán
6,664 Points

I think, the S2 takes the icons from the res/drawable-mdpi folder, but the Nexus5 takes from res/drawable-xhdpi folder. Are you sure you have the the same icon (file names should be the same) in different sizes in each res/ folder ?

Harry James
Harry James
14,780 Points

As Gergo said, the Samsung Galaxy S II will take the image from a different directory. Nexus 5 is from the xhdpi folder and S II is actually from the hdpi folder. Check out http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density for information on this.

Like Gergo said again, make sure you have the same icon in different sizes (You can have them all the same size however, it's recommended that for performance, you decrease the quality as you go down.

Here are some example resolutions that are good to stick to:

// xxhdpi --> 144x144
// xhdpi --> 96x96
// hdpi --> 72x72
// mdpi --> 48x48
// ldpi --> 36x36
//
// I wrote this in a code box as the ordered list wasn't working for me :'(

Hope it helps! :)

Rui Silva
Rui Silva
2,540 Points

Thank you guys!

Problem solved! :)