I've come across with this table showing what Android uses as baseline for screen density:

Here i understand that if my mdpi image is 100px, then i have to use 150px(1.5 factor) for hdpi.
Question 1: Does mdpi targets screen densities between 120dpi screen and 160dpi screen? Because my phone has 432dpi(or ppi) and it uses xxhdpi, so i thought xxhdpi targets screen densities between 320dpi and 480dpi, right?
But here i've came across with different table, showing example:

Question 2: According to assumption above, xhdpi should target between 240dpi-320dpi, but in second table 336dpi is also considered as xhdpi, why? And what happens if user has screen density > 480dpi and i don't have xxxhdpi folder?
Android picks the right density bucket for a given DPI value based on the bucket which has the least difference in DPI value.This can easily be seen in de following image:

Quote:
Figure 1. Illustration of how Android roughly maps actual sizes and densities to generalized sizes and densities (figures are not exact).
Source: http://developer.android.com/guide/practices/screens_support.html#range
Question 1: Mdpi targets roughly anything between 140 DPI and 180 DPI.
Question 2: 336 DPI is considered xhdpi because the xhdpi bucket is the closest one (in DPI value: 6). The difference to the hdpi bucket is 96 and the difference to the xxhdpi bucket is 144.
When a density folder is missing Android picks the best alternative folder and if needed applies scaling to the resources to match the target density.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With