There are really two related things here:

1 - Setting anyDensity to "true" or minSdk/targetSdk to 4 or above means that your application sees the real screen size/resolution/density at runtime. Android will scale your images as needed when they are loaded, so you won't get missing resource exceptions, but they may not always look very good, especially when scaling up, say from -mdpi to -hdpi density.

You can look at Android's own resources as an example of this scheme:

android-sdk-windows\platforms\android-X\data\res

has drawable-mdpi and drawable-hdpi, but no drawable-ldpi, relying on runtime scaling from -mdpi to -ldpi.

2 - Using "sp" and "dp" units in your layouts makes them scale with density, so one layout should work for all densities (although you should still test them on a variety devices, because of different screen aspect ratios, this is especially apparent with QVGA screens).

-- Kostya

10.04.2011 23:10, MarcoAndroid пишет:
In short: am I always safe with anyDensity=true as long as I use dp
and sp as I read in Table 2 
here:http://developer.android.com/guide/practices/screens_support.html:
'That is, as long as your application uses density-independent units
(dp) for screen layout sizes, then it will perform properly on
different densities when this attribute is set to "true"'?
Even for a 1.5 app?

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to