Hello,
I have an app that I would like to keep 1.5 compatibility but support the
additional display resolutions of more recent devices like the Droid. I've
read the suggestions in the dev guide, specially the legacy applications
section, since that's exactly what I want to do.
I'm not running in compatbility mode, so anyDensity is set to true and all
screen sizes are allowed in the manifest. I've recreated all my graphical
elements so they don't get upscaled on a 480px-width screen (called
"hires-bitmaps" in the following).
If I put the hires-bitmaps into drawable-hdpi and leave the others in
drawable, the emulator2.0 (WVGA854, density @ 240) displays them perfectly.
On the other hand, the emulator1.5 (320x480, density @ 160) - and my HTC
Hero - ALSO use the hires graphics in drawable-hdpi. That's a problem
because the hires graphics scale slightly differently and I don't want the
app to resize too much.
As mentioned in the dev guide I can prevent this by adding the API version
number to the resource folder. Not very convenient since I'd have to keep
the hires bitmaps twice (drawable-hdpi-v4 and drawable-hdpi-v5), but I
nevertheless tried it. Result: emulator2.0 uses low-res graphics from
"drawable" (which is bad), emulator1.5 as well (which is good). And what's
weird: emulator1.6 (WVGA854, density @ 240), uses hires-graphics. Now that
seems odd.
I've tried some other combinations, including the deprecated -<resolution>
qualifier, but no luck. Is there anyone who has accomplished something
simliar?
Again, in a nutshell: I just want to offer hires graphics for resolutions
greater than HVGA so the current ones don't get upscaled. All the rest is
taken care of ("dip" units everywhere with the according conversions in the
code).
Generally I must say there is one thing that I don't grasp. Concerning
layouts, the principle of dealing with screen sizes and densities instead of
physical resolutions makes sense. Layouts should be able to be arranged
differently according to screen size and density. But when it comes to
bitmaps, it doesn't make so much sense to me (unless I'm missing something).
Why would I want to create my bitmap for a screen size "normal", which can
have five very different resolutions, or for a density "medium" with also
several resolutions? For graphical elements where I must supply a bitmap
containing physical pixels I want to know on how many pixels it is finally
displayed. I don't particulary care about the screen's physical
measurements.
What I'm looking for would be an approach that qualifies resources by screen
width in pixels (still talking about bitmaps here). Small for <=240px,
medium for <=320px and large for the rest. That's because layouts are
typically based on screen width and less on the height.
Am I borderline trolling or are these issues others encountered as well? Any
feedback would be great, or even more pointers or suggestions to a potential
solution to my problems :)
Cheers,
-freezy.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en