1
votes

This has to be one of the most over asked questions on here which is often just directed to the android developer site. After reading the documentation, I just wanted to come here and clarify.

I understand the there must be different drawables for each screen size and density to create an optimized user experience. I want just a simple background image. Therefore I need to create a background image for mdpi, hdpi, xhdpi, xxhdpi. After researching I found the following sizes for these size folders:

xlarge (xhdpi): 640x960 large (hdpi): 480x800 medium (mdpi): 320x480 small (ldpi): 240x320

resource answer: Android splash screen image sizes to fit all devices

But question, I didnt think ldpi was used or required anymore and where is xxhdpi?

After I have my image sizes I can center it and be good :) Thanks!

1

1 Answers

1
votes

To create an image for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and xxx-high respectively).

enter image description here

The sizes you provided already dont follow this pattern, so they are either wrong or outdated.

However, following your xhdpi value, we can get xxhdpi:

xxlarge (xxhdpi): 960:1440 xlarge (xhdpi): 640x960 large (hdpi): 480x800 medium (mdpi): 320x480 small (ldpi): 240x320.

(recomended to always round up to set of ten)

But as you can see it is not consistent with the other values, because they use a different ratio. So you will have to re-work your resources size to adapt them to the standard.

Ldpi is just not supported anymore by android iconography. Also discouraged.

Link with official documentation here.