1
votes

Which is the correct sizes of background images for the different densities ldpi, mdpi, hdpi, xhdpi, xxhdpi?

I have transparent background images (.png) and want to reduce image size as much as possible. (not concerning the .apk size, but concerning memory issues on lesser powerful devices)

I assume, the first thing is to make sure the images are in the correct sizes, so that they do not need to be scaled. However, I don't know how the densities relate to certain screen resolutions (if any).

What other options are available to reduce image size . I am using GIMP to create the background images. Which settings should I use in GIMP?

Any recommendations?

EDIT: Should a device with a 800 x 480 pixel screen use a background image of 800 x 480 pixel? Android would not have to scale it, but on the other hand, the image would require a significant amount of memory?

What would be the best resolution?

And how do I know which devices have which screen size?

I.e. the SGS GT-I9000 has 800 x 480, but is a ldpi device (only 233 dpi).

1
I'm not using GIMP so cannot answer on that question, however take a look at developer.android.com/guide/practices/screens_support.html ,might help youEri
I am always checking the documentation first. However, the docs dont have any information regarding my question. :(mrd

1 Answers

2
votes

The only solution I know for this is using 9-patch. Of course, it puts a restriction on the nature of the background you are using but in most cases it solves the problem.

http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch