Question

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).

Was it helpful?

Solution

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.

OTHER TIPS

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!

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)

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top