androidandroid-layoutandroid-resourcesandroid-drawableandroid-resolution

Supporting Multiple Android Screens: Advantages vs. disadvantages of having drawer folders (images) for all densities?


I don't get why it's recommended to have a drawable (image) for all densities (ldpi, ..., xxhdpi).

Would it not be better to add one file with the highest needed density (xxxhdpi) and than programmatically scale that image down (e.g. for tab icons I could just set a explicit dp size)?

Therefore I would only have to manage one file and the APK file size would be smaller. I think the performance disadvantage should not be significant.

Update 1:

To be more specific: I never noticed any quality loss when using a high density image (PNG file) which was scaled down to a explicit dp value on my mdpi device.

So I was considering if the disadvantages of managing multiple image files as a coder without a designer (and the higher APK file size) might outweigh the advantages. Especially if I'm going to target newer devices (API >= 17).

Update 2:

In my case I'm more a coder than a designer. In the microphone example image of @mes I could just use a high density version of the left microphone and scale it down with no significant disadvantages?


Solution

  • There's no significant advantage, when designer or you simply reduce image size and put inside the ldpi, actual meaning is to paint another image for small size, because there are many cases, when simply reducing an image size produces inacurate and low quality image, and a good designer will draw another image, with few details in it, this is an example, only in this case worth to put different images in different folders Icons

    Therefore I would only have to manage one file and the APK file size would be smaller. I think the performance disadvantage should not be significant.

    Yes, you are right, there no significant performance improvements, and also apk size is increases, that's why not worth to downscale the same image.