Wow this completely explains what happened to me after updating to the
2.2 SDK. The documentation goes into detail about how the current
environment picks hdpi or ldpi or what have you, but doesn't explain
how previous versions operate at all. From a beginner's mindset, it
seems to follow that since 1.5 wasn't dpi aware that it wouldn't read
resources out of any folder containing a dpi setting (even mdpi). But
this is not the case and it took me trial and error to understand the
way it works. It is also not clearly mentioned that the solution is to
do a hdpi-v4 and ldpi-v4 directory and an mdpi directory. In fact this
was specifically not the solution recommended at Google IO a couple of
days ago.

So in conclusion, thanks for finally revealing how this works now (and
has worked in previous androids) Dianne, and I would gladly write up a
documentation patch but I don't think the d.android.com articles are
in gerrit right?

-Eric

On Jun 8, 8:57 pm, Dianne Hackborn <hack...@android.com> wrote:
> Um, no, you should use -hdpi-v4 so that v3 of the platform does not see the
> hdpi resource (which it does not understand) as a possibility.
>
> Also as of 2.2 aapt will automatically include the appropriate minimum
> version for new configurations, so that older platforms do not see them.
>  Though I notice that it uses -v4 for a resource that has ANY density
> specified, so if you don't have default resources for images you may break
> on 1.5.  That is, you'd want drawable/, drawable-hdpi/, etc; and aapt will
> turn this in to drawable/ and drawable-hdpi-v4/ for you.  If you have
> drawable-mdpi/ and drawable-hdpi/ you will end up with drawable-mdpi-v4/ and
> drawable-hdpi-v4, neither of which v3 (1.5) can accept.
>
> I should probably leave -mdpi as not having a version config...  I think 1.5
> can still handle those, though I'll have to check.
>
> (Note aapt also adds -v4 for -normal, -large, -small, -long, and -notlong;
> and -v8 for -car, -desk, -night, and -notnight.)
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
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