Android 1.6 display scaling

45 views
Skip to first unread message

QF

unread,
Sep 24, 2009, 4:32:44 PM9/24/09
to android-platform
I have applications created for WVGA (800x480) devices and need to
make them run on WSVGA(1024x600) devices. Instead of redsign the app,
I would like to take the advantage of the new 1.6 release.

Can anyone shed some light where is the back-end codes for scaling the
application to fit different screen sizes?

Thanks,
QF

Dianne Hackborn

unread,
Sep 25, 2009, 1:22:12 AM9/25/09
to android-...@googlegroups.com
This is confusing.  480x320 was the only size supported prior to 1.6, so if you designed an application for that before 1.6 you are probably going to want to go and make sure it works right now that the platform officially supports it.

Also you can't talk about screen sizes without mentioning density.  Without both, you could be talking about very different things.

Finally, 1.6 does not support 1024x600.  Only QVGA/WQVGA low density, HVGA medium density, WVGA/FWVGA medium density, and WVGA/FWVGA high density.
--
Dianne Hackborn
Android framework engineer
hac...@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.

QF

unread,
Sep 25, 2009, 5:14:54 PM9/25/09
to android-platform
The application is for a customized hardware. The initial design is
800x480 and the new generation hw is 1024x600. The density is higher
but both screens are 7''.

On 1.5 emulator, if I create a skin with 1024x600 (has to change the
kernel to give a bigger frame buffer), the app will take the upper
left 800x480 corner. With 1.6 emulator, the behavior changed. But I
was expecting a 1024x600 with ~200dpi should be rendered the same as
800x480 with 160dpi. (All our layout uses 'dp' or 'dip' as units).
However, what I get is rendered with 240 dpi (regardless I gave 200dpi
or 220dpi). So I am suspecting somewhere in the framework the scaling
factor ( for converting from dp to px) is round up. I still have not
find out where it is yet. If you can shed light, it will be very
helpful.

Thanks,
QF

On Sep 25, 1:22 am, Dianne Hackborn <hack...@android.com> wrote:
> This is confusing.  480x320 was the only size supported prior to 1.6, so if
> you designed an application for that before 1.6 you are probably going to
> want to go and make sure it works right now that the platform officially
> supports it.
>
> Also you can't talk about screen sizes without mentioning density.  Without
> both, you could be talking about very different things.
>
> Finally, 1.6 does not support 1024x600.  Only QVGA/WQVGA low density, HVGA
> medium density, WVGA/FWVGA medium density, and WVGA/FWVGA high density.
>
> On Thu, Sep 24, 2009 at 1:32 PM, QF <qfmob...@gmail.com> wrote:
>
> >  I have applications created for WVGA (800x480) devices and need to
> > make them run on WSVGA(1024x600) devices. Instead of redsign the app,
> > I would like to take the advantage of the new 1.6 release.
>
> > Can anyone shed some light where is the back-end codes for scaling the
> > application to fit different screen sizes?
>
> > Thanks,
> > QF
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

Dianne Hackborn

unread,
Sep 25, 2009, 7:37:30 PM9/25/09
to android-...@googlegroups.com
Be careful about DPI vs. density.

For scaling the UI, we call this density, and there are currently 3 choices: low (approx 120dpi), medium (approx 160 dpi), and high (approx 240 dpi).  These impact bitmap/resource selection, dp/dip and sp units, and how old applications run in density compatibility mode.  The true density of the device is the xDpi and yDpi values of DisplayMetrics, and the -only- thing these impact are the in, mm, and pt units.

The density is set with the system property; the true dpi is taken from what the graphics driver reports.
hac...@android.com
Reply all
Reply to author
Forward
0 new messages