Resource Packs for Android swXXXdp for 5-inch Phones

I want to distinguish phones with displays of size ~ 5 inches and above from 4-inch 480x800 in the res / values ​​folder

How can I distinguish ~ 5 inch displays? I should probably use this trick, but what should happen instead of XXX?

values-swXXXdp? 

Especially I try to distinguish Galaxy S 3 and Galaxy S 4 from others. What should I consider?

+4
source share
1 answer

S3:

 DPI: 306 RES: 1280x720 Screen: 4.8" 720 / (306/160) = 720 / 1.9125 = 376.47 dp 

S4:

 DPI: 441 RES: 1920x1080 Screen: 5.0" 1080 / (441/160) = 1080 / 2.75625 = 391.8367 dp 

So basically there is a very small difference between S3 and S4. But if you want to distinguish layouts for these devices, use sw376dp for S3 and sw390dp for S4 . But note that other 5-inch phones may be different.

+3
source

Source: https://habr.com/ru/post/1500353/


All Articles