I've deloped an Android game which supports almost resolutions in the market (240x320, 320x480, 480x800, 480x854, 600x1024).
My problem is when I'm trying to support tablets, I don't understand why Android divide the resources in different folders (hdpi, ldpi, mpdi, large-mdpi, ...) when that qualifiers isn't useful! I have several graphics sets (according width) but I'm going crazy, for example, with the tablets 480x800 with density mdpi or ldpi! It's is impossible reach every device.
So, do you know any way to divide drawables/bitmaps in folders but only accesible through resolution?? Yes, I know Bitmap Alias but it's not the solution.
Thanks
I believe you're mixing screen size with pixel density:
From the dev guide:
Edit: added my comments to the response.
Using the example in the comment, the Archos is a 7 inches screen, while the Nexus One has a 3.7 inches screen. At the same number of pixels, the density of pixels is double on the Nexus One. Remember, dpi means dots per inch. That means that the same image would be rendered twice as big in the Archos than in the Nexus One.
The screen size differences should be handled in the layout. Use
res/layout-normal
for the Nexus One andres/layout-large
for the Archos. This way, you will have control over the full layout for the different screen sizes (perhaps you need to limit some widgets that would be unnecessarily large in the Archos) and decide whether you want to keep a fixed size for your drawables or expand them as necessary.Alternatively, if you really want to keep size proportional to the screen regardless of screen size and without stretching images, then you can create two sets of images, namely image1-normal.png, image2-normal.png and image1-large.png, image2-large.png, etc, both in the
res/drawable-mdpi
and theres/drawable-hdpi
folders, that you would access from the xml files inres/layout-normal
andres/layout-large
.In summary, the full requirements should be handled by a combination of layouts and drawables:
layout-normal
,drawable-hdpi
layout-large
,drawable-mdpi
layout-xlarge
,drawable-mdpi