androidresourcesscreens

UI for different screen densities


I don't understand the benefit of resources configuration qualifiers designed to support multiple screen densities, for example :

Then you display this icon in an imageView of dimensions 100 x 100 dip which already maintains its size on multiple screens of different sizes and densities.

Why don't we just use the xhdpi version of the icon in the resources above as a baseline resource so that it gets displayed nice and smooth on higher density screens, and at the same time android will rescale it to fit lower density screens for which the xhdpi version of the icon will be enough anyway?

I hope I am clear in my explanation, thanks


Solution

  • You are certainly welcome to just ship -xhdpi drawables and have Android downsample as needed. I expect that many developers do just that.

    However, please understand that you are no longer in control over what your drawables look like on lower densities. You are placing your trust in Android's drawable resampling algorithm, which:

    Shipping alternative artwork in different densities gives you more control, albeit for greater development effort and a larger APK size.

    If you do not want that control, that is your choice. At the same time, please do not begrudge other developers' desire to have that control and have potentially higher quality results on lower-density devices.