3

I want to create backgrounds for my Android game. And while reading here I get how it works, what I don't get is how to set the correct size in Photoshop for the different folders.

Here is the list from Android Developers:

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

But what would this be in pixels? Since Photoshop doesn't have dp. How can I make a list like the following?

  • Small screens are at least <Insert pixel size here>
  • Normal screens are at least <Insert pixel size here> (...)

I don't want my background to stretch and shrink to much, so I would like at least four different sizes.

Manuel Allenspach
  • 12,467
  • 14
  • 54
  • 76
Green_qaue
  • 3,561
  • 11
  • 47
  • 89
  • dp is not a constant; you can't convert 1dp to pixel units. Screen resolution is indeed related to it, but physical screen size also matters. Best approach would be having different images with different aspect ratios, choosing one that fits screen's aspect ratio and then scaling to screen resolution. – mehmetminanc Sep 08 '12 at 23:35
  • Going that route, I'd do at least a 4:3, 16:9, 16:10, and maybe 3:2 for the oddballs. – Geobits Sep 09 '12 at 05:04

3 Answers3

2

One of the key things on the Supporting Multiple Screens page you linked is this:

To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8 scaling ratio between the four generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon), all the different sizes should be:

36x36 for low-density 48x48 for medium-density 72x72 for high-density 96x96 for extra high-density

That being said, since we know most of the screen sizes and densities available (here's a neat reference page I just found: http://blog.blundell-apps.com/list-of-android-devices-with-pixel-density-buckets/), you can use that as a guide, too. So, to create a background which fills screen, I would focus on width resolution. Most popular phones are either 320, 480, 540 or 720 pixels in width. So I would create my backgrounds as such (phones only... you can do the math for tablets)
mdpi: 320 wide
hdpi: 540 wide
hxdpi: 720 wide

Height is a bit more complicated because not all phones are the same aspect ratio. Depending on your app you have the option of scaling height or clipping height.

I'd also take a look at the Screen Sizes and Densities chart on this page: http://developer.android.com/about/dashboards/index.html. As you can see ldpi is a tiny percentage, so you might prefer to just let android do the scaling. On the other hand, ldpi images are likely small in file size, so if you want to make sure it looks great, you can provide the assets. For xlarge tablets you probably only care about mdpi right now.

Jens Zalzala
  • 2,546
  • 1
  • 22
  • 28
  • so Lets say im testing my game on a device that is xhdpi (I am using nexus that is xhdpi), then if a pic is `960x640` (a background), that pic should be `960x640*0.75` for hdpi, and `960x640*0.5`for mdpi? – Green_qaue Sep 13 '12 at 15:56
  • For any image the answer would be yes... unless you your background actually fills the screen, in which case you probably want it to match the phone resolution. Since the Galaxy Nexus resolution is 720x1280, you probably want to use that as your baseline, instead of using the iphone's 960x640, which will cause scaling. (The tricky part is once again height, since it's not the same on all phones. The Galaxy Nexus, for example uses the bottom 96 pixels for the navigation bar, while the HTC One X and Galaxy S3 don't). – Jens Zalzala Sep 17 '12 at 23:38
  • im scaling bitmaps to fit so they will always fit, and 960x640 look good so Im sticking with that, dont want my animator to re-do ecerything. but good to know for future projects :) – Green_qaue Sep 18 '12 at 14:06
  • actually tried 1280x720 and it looks so much better :P thanks for the tip – Green_qaue Sep 18 '12 at 16:13
1

I am not sure what you are looking for exactly, but here are some sizes in pixels:

    320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).  
    480dp: a tweener tablet like the Streak (480x800 mdpi).  
    600dp: a 7” tablet (600x1024 mdpi).  
    720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc.).

It is taken straight from Stack Overflow question Android screen size HDPI, LDPI, MDPI.

Community
  • 1
  • 1
Green_qaue
  • 3,561
  • 11
  • 47
  • 89
0

On average, pixels per __, in Imperial, and Metric, most commonly used units only. (Sorry, I don`t know what it is in dpi.)

300 pixels per inch
118.1102362204724 pixels per centimeter
11.81102362204724 pixels per millimeter

Sources

Google Length Unit Converter
Google Online Calculator
Some other guys yahoo answers post

Ben
  • 2,200
  • 20
  • 30