Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difficulty to understand how to support multiple screen

I have seen so many questions on StackOverFlow how to support multiple screens. But most of the answers provide this link and this. And in the first one link I have got this. I am working with screen sizes first time so please help me.

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

And in case of xhdpi they suggest 320 density. I am confused so I have following questions.

  1. Like if I want to create Background image for xlarge screen then 960dp x 720dp means I have to create image with width 720 pixels and height 960 pixels and resolution 320 in portrait mode?

  2. And if I want to create Background image for large screen then 640dp x 480dpp means I have to create image with width 480 pixels and height 640 pixels and resolution more than 200 in portrait mode?

  3. The sizes above is for landscape mode i.e 960dp for width and 720dp for height ?

like image 981
John R Avatar asked Nov 15 '25 13:11

John R


1 Answers

From Android: Supporting Multiple Screens

px = dp * (dpi / 160)

Illustration of how Android roughly maps actual sizes and densities to generalized sizes and densities (figures are not exact)


So for your example:

Your image dimensions are 960dp x 720dp and your dpi is 320 (which you can see falls under XHDPI).

Height = 960dp * (320 / 160) = 1920px

Width = 720dp * (320 / 160) = 1440px

Height and width are arbitrary depending on the orientation of the phone

like image 62
Tyler Avatar answered Nov 17 '25 09:11

Tyler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!