tags:

views:

92

answers:

3

I'm wanting to target WVGA (480x800) and FWVGA (480x854) devices with my program. My question is: for my full screen background bitmaps which resolution should I make them?

A: 

Be flexible. Android can be run on many different devices, and it would be a very bad idea to limit yourself to certain resolutions. Instead, write your code so that it scales. (Keep it mind that you might have to crop the image if necessary, or live with different aspect ratios).

Just as food for thought... there are Android devices with 480x320, 240x320, 480x800, 480x854, not the mention the upcoming Samsung tablet at a higher resolution. Limiting yourself to a certain resolution would be bad.

Here is something from the SDK you may want to read up on too: http://developer.android.com/guide/practices/screens_support.html

EDIT: Assuming that you're focusing on those two resolutions -- I would say it depends on your image. Your best bet may be to go for 480x854 and design the image in such a way that it won't look bad if you lose 27 bytes on either side. If that's impossible, make it 480x800 and add black bars on either side if run on 480x854.

EboMike
Since my phone is 480x320 I've actually developed my game for that resolution. But I'd also like to support other resolutions as well. I've got bitmap backgrounds for 480x320. I was going to create larger versions for the larger screens so that they wouldn't have to be scaled.
Slapout
+1  A: 

There are a few ways you can attack this issue.

Make one background per aspect ratio and calculate which to use when the app starts. Find the aspect ratio by dividing the width by the height.

Make one background with filler on the sides and bottom for cropping, when you display the image resize it's dimension which has the largest difference from that of the screen's resolution to the exact screen resolution. This will cause the bottom or sides to get cropped a bit.

You could also use a combination of these strategies to create a couple backgrounds, one each for a range of aspect ratios, and then use the cropping strategy to take up the negligible difference.

joshperry
A: 

you can get any bitmap and convert it into a drawable using BitmapDrawable .Then you can set bounds to the drawable to match your screen background.

Siddhartho