Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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! :)