Android design screen sizes in pixels?

As I found on the documentation site android, there are 4common screen sizes for Android devices. but i found the measurement unit in dp. eg:

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

How to do it in Photoshop, how to get the dimensions in pixels? Do I need to have 4 design ldpi, mdpi, hdpiand xhdpi? I need to have 16 design versions.

+5
source share
4 answers

yes, you have 4 projects like:

xhdpi = 100% image
hdpi = 75% image of xhdpi image
mdpi = 50% image of xhdpi image
ldpi = 50% image of hdpi image

ie:

If you have 96 x 96 images in xhdpi, then you need to put

72 x 72 in hdpi folder - ( 75 % of xhdpi )
48 x 48 in mdpi folder - ( 50 % of xhdpi )
36 x 36 in ldpi folder - ( 50 % of hdpi )
+3
source

How to do it in Photoshop ?

Just create a high resolution version of your image with a width and height as a multiple of 16

Photoshop Android script

  • drawable-XXXX "

16 ? :

ldpi   mdpi   tvdpi     hdpi    xhdpi   xxhdpi  xxxhdpi
0,75   1      1,33      1,5     2       3       4
3      4      5,32      6       8       12      16

SO : dpi.

+2

Android: = "@/ImageName"

, XML ,

0

, , , png, . , 4

you need to target the screen fist, for example, you aim xhdpi, then its 960px * 720 pixels with a density per inch, like 320px

Now in Photoshop, do all your projects with a maximum length of 960px and a maximum width, since the density of 720px will maintain a density of 320. Now, to change the scale, the image density is 240 for hdpi 160 for mdpi and 120 now your images will increase in size now scale them as indicated in ajay's previous answer.

0
source

All Articles