4

I was wondering, why are we using different launcher icons (sizes) in android. Currently you "have" to resize your icon to:

LDPI - 36 x 36
MDPI - 48 x 48
HDPI - 72 x 72
XHDPI - 96 x 96

And put them in the desired folder. But does it really matter if you would only put a xhdpi icon in your android application, and if you just leave the ldpi, mdpi and hdpi folder empty.

If you try the app with this configuration (only a xhdpi icon) on a mdpi device, automatically the xhdpi icon is used (I assume the device scales the icon automatically), and it looks just normal.

So what would stop us from only making a xhdpi icon. It will still result in a sharp app icon for every device (except xxhdpi ofcourse).

Aditya
  • 5,509
  • 4
  • 31
  • 51
Mdlc
  • 7,128
  • 12
  • 55
  • 98

4 Answers4

5

Rescaling overhead. Your icons may be used not only by your app, but also by few others. Like launchers, setting apps for installed software, share menus in many places.

Note that the higher the resolution, the more powerful the hardware. The lower the resolution, the less powerful the hardware. You may take an easy exercise. Open up an image in Gimp with resolution of 3000x3000. Scale it down to 50%. Even on a high end desktop it will take some time. Not long, but will.

Joel Bodega
  • 644
  • 5
  • 8
  • the experiment with gimp has nothing to do with DPI. the DPI is just a number inside the metadata of the image, and does not affect the image or the file in any way. it's just a piece of information for the printer how to show the image. scaling a 3000x3000 image with 1DPI is the same as scaling a 3000x3000 image with 10,000DPI . i don't understand why this answer was chosen to be the correct one, since the performance is quite negligible for launcher icons (which are very small compared to what you've written). – android developer Jul 13 '13 at 21:47
  • Yes, they are small. But do smartphones have a comparable in any way hardware to a desktop you are working on? Of both you mentioned, quality and scaling overhead, the latter will make the difference for a user. Screens are small and most scaling imperfections will go over user's head as he is not a graphic designer. Milliseconds add up on the other hand. On each device differently. If the scaling time factor didn't play a role at all, we wouldn't have size guidelines. – Joel Bodega Jul 14 '13 at 12:29
  • both are important, but you have to know where to put the balance , since the more files you put, the larger the app. for launcher icons, you should put the images for both quality and performance. if quality didn't matter for you and only performance, you could have a splash screen (showing something like "initializing for the first time") that scales all of the images on the very first run and put them all in the internal storage of the app. so , the main reason is quality. the performance here is a bonus, especially for small files. – android developer Jul 14 '13 at 12:40
  • even the documentation talks about this: http://developer.android.com/guide/practices/screens_support.html "To ensure your bitmaps look their best, you should include alternative versions at different resolutions for different screen densities." – android developer Jul 14 '13 at 22:50
1

As described here in the documentation provided by android it is better to use different variants of drawables mainly because of the following reasons.

  1. Rescaling is an overhead for the mobile device's processor.
  2. You will not get the perfect image when using on different phones because it will get pixelated or blurred.
  3. You will have to handle the image sizes to fit in the layouts to give the same look and feel on all the screens.

Also creating one icon for xhdpi and using it for hdpi, mdpi and ldpi won't create sharp looking images. It will create drawables where pixels are overlapped on each other, giving the feel of a sharper image in hdpi but might not be viewable on either an mdpi or for sure on an ldpi screen. Down scaling the images is as deteriorating in terms of quality as is up scaling.

So it is always better to have different launcher icons for different screens!

Karan Rampal
  • 433
  • 4
  • 9
0

Although the system performs scaling and re-sizing to make your application work on different screens, you should make the effort to optimize your application for different screen sizes and densities. In doing so, you maximize the user experience for all devices and your users believe that your application was actually designed for their devices—rather than simply stretched to fit the screen on their devices.

This following five factor decide which assets is convenient to your device

  • Screen size
  • Screen density
  • Orientation
  • Resolution
  • Density-independent pixel (dp)
dharmendra
  • 7,835
  • 5
  • 38
  • 71
  • Ofcourse, but if we have a look at the icon only, and we are not stretching it, we do the opposite, so "icon only" this should not be a problem. – Mdlc Jul 13 '13 at 10:21
  • @Mark029348 even one single assets should not be a problem , but as it may chance to get starched(in high-res devices ) or pixel-ed (in low res. device) so to prevent this situation we normally make diffident icons – dharmendra Jul 13 '13 at 10:27
0

there are 2 main reasons that i can think of, and they are the same for any image and not just launcher icons:

  1. scaling might ruin the output image. it might make it blurry, pixelleted , or lose the wrong pixels. when you create the exact icons you wish to use, you will always know what you get. this is because the images are not vector-based so they can't scale nicely.

    here's a quote from the documentation:

    To ensure your bitmaps look their best, you should include alternative versions at different resolutions for different screen densities.

  2. scaling takes CPU time from the device. sure, it might not be important, but it's something...

the disadvantage is that your app will take more space.

so, what i think is that for some images you should create all of the density screens, and for some you can use xhdpi or xxhdpi (or even hdpi) images and not use the others.

btw, there is also xxhdpi launcher icon which is 144x144 (see here)

android developer
  • 114,585
  • 152
  • 739
  • 1,270