> ImageButton containing an image which is 48 pixels high (i.e. 10% of
> the screen hight in portrait mode) it's hight is still 48 pixels on
> the 1.5 Archos WVGA skin (thus making it only 6% of the screen hight
> in portrait mode), but on 1.6 it's scaled so the image ends up being
> 72 pixels high (thus making it around 9% of the screen hight, closer
> to the original).

This has nothing to do with WVGA, this is about the pixel density of
the device. I don't remember what we've done in the 1.6 SDK but it
looks like the WVGA skin is using a high density configuration
(probably 240 dpi.) You can very well run the 1.6 emulator in WVGA
with a density that matches Dream/Magic/Hero/Galaxy/etc.

> This means that on a 1.5 WVGA device the layout can look sparse and
> odd, whereas on 1.6 it looks a lot closer to what you originally had.

Android 1.5 actually has limited support for higher and lower
densities. The device has to be built with the information about the
screen density so that images can be scaled accordingly.

If your app is correctly using layouts and not according positions, it
should work fine on a WVGA "normal" density device (screen density of
a Deam, which means a 5" WVGA display.) If you want your app to work
on a high-density or low-density device (for instance a 3" WVGA or a
3" QVGA display,) Android 1.6 will be required.

>If you have an app which doesn't have a supports-screens tag or
>declare a minimum SDK level of 4 (yup, declaring minimum SDK of donut
>alters the layout behaviour)

It doesn't really alter the layout behavior. It takes the app out of
compatibility mode. In compatibility mode, the application runs as if
it was on an HVGA standard density device (a Dream/Magic/etc.) This
way the app works as it's supposed to. When you compile against SDK
level 4, we assume you are aware that you must now support different
resolutions and/or densities. Your app is taken out of compatibility
mode and is laid out based on the actual screen resolution. At this
point, your app is still using a limited compatibility mode: if the
device has a density that is not 160 dpi (or close, a Dream is
actually 180 dpi but is assumed to have 160 dpi,) the bitmap resources
are scaled to match the screen density (a 100x100 bitmap becomes
150x150 on a 240 dpi device, or 75x75 on a 120 dpi device.)

Your job as an app developer is to:
- Make sure your activities layout correctly in various resolutions (HVGA, WVGA)
- Decide whether you want to use assets specific to various screen
densities (drawable-hdpi/ for displays > 160 dpi for instance.)
- Correct possible use of absolute pixel dimensions in your code by
taking into account the screen density (DisplayMetrics.density gives
you the correct scale factor)

Of all those 3 points, the second one is optional. Taking care of it
will make sure your app looks great.

I know this is all complicated and probably confusing (and this email
is light on details and does not cover everything) but when Android
1.6 is released, we'll tell you everything there is to know about
supporting various resolutions and densities.

P.S: Now some of you might understand why we deprecated AbsoluteLayout
to discourage its use :)

-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to