5

As I found in android documentation site, the there are 4 general sizes for android devices screens. but I found the measurements unit in dp. like this :

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 that on photoshop, how to get the sizes in pixels ? Do I need to have 4 design ldpi, mdpi, hdpi and xhdpi ? do I need to have 16 versions of the design. ?

Adham
  • 61,516
  • 96
  • 221
  • 343
  • 2
    First create images for normal screen because the 470dp X 320dp is equal to 470px x 320px.Then design the image with this [Link](http://coh.io/adpi/) for other screens. – Yugesh Apr 01 '13 at 10:57
  • so for each screen size , I will have 4 designs – Adham Apr 01 '13 at 10:59
  • ya four designs.But single image is possible to set for all XML designs. – Yugesh Apr 01 '13 at 11:07
  • @Yugesh I mean the background design :) – Adham Apr 01 '13 at 11:12
  • how is it possible means for example 56px X 56px for mdpi is equal to 84px X 84px hdpi.hdpi is perfectly fit for 56px mdpi but if you use 56px for 84px hdpi means the pixels will be broken. – Yugesh Apr 01 '13 at 11:24
  • @Yugesh : your comment is little helpful, can you please clear your comment (Answer) that what you are actually trying to say. :) – Ajay Apr 01 '13 at 11:32
  • @Ajay_Addon [http://coh.io/adpi/](http://coh.io/adpi/) if your button size is 56dp X 56dp in mdpi but same button in hdpi is 84dp X 84dp.If you create the image for the button in 84px X 84 px means it fit for both mdpi and hdpi.Just enter 56 X 56 in above link.you will understand easily. – Yugesh Apr 01 '13 at 11:45
  • @Yugesh : i have already using this link for images. see my last comment below answer.. – Ajay Apr 01 '13 at 12:04
  • @Ajay_Addon till you didn't understand. – Yugesh Apr 01 '13 at 12:08

4 Answers4

3

yes you have 4 designs like :

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

i.e :

if you have 96 x 96 image 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 )
Ajay
  • 1,259
  • 12
  • 28
  • I know this, but I am asking about the screen size, as I want to create a background image .. do I need 16 images in this case ? – Adham Apr 01 '13 at 11:04
  • Look at here: http://developer.android.com/guide/practices/screens_support.html MDPI is 100%, HDPI is 150% ... – Serafins Feb 19 '14 at 20:42
2

How to do that in Photoshop?

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

Then use my Photoshop Output Android Assets script to generate

  • down-scaled version of images
  • AND "drawable-XXXX" folders for them

Why 16 pixels? For good down-scaling results:

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

Check my SO answer here for more information: What is the best way to create drawables for different dpi

Community
  • 1
  • 1
Pascal
  • 12,592
  • 2
  • 48
  • 63
0

With my app I chose one screen size for it Hdpi And only used one image android:background="@drawable/imagename"

If you want one for all sizes make one image Resize it for each one Then edit the XML file so that it can be used by the activity

0

See there are may ways, If your background has repeating patterns you can use nine png,you ll get a lot on the internet for the same. But if there is no repeating pattern u hve to make 4 images

to do you need to target screen fist for example you target xhdpi then its 960px*720 pixel with density per inch as 320px

now in photoshop make your all designs with considering max length as 960px and max width as 720px keep density as 320. Now to scale change the density of images as 240 for hdpi 160 for mdpi and 120 now your images will increase in size now scale them as mentioned by ajay in above answer

Rohit
  • 1,001
  • 1
  • 11
  • 20
  • Thanks, that when I want to target screen 960px*720, what id I want to target all 4 standard screen sizes, I need to do the same . right ? – Adham Apr 02 '13 at 05:16