On Mon, Oct 19, 2009 at 5:35 PM, Mark Hansen <[email protected]> wrote:

> I know with certain assets you can append -320x240 for instance to the
> filename and the sdk will pull the asset that fits the resolutions.


I strongly recommend not using this; it was a bad idea from the start.
 Doing so pretty much guarantees that you will break on some subtle device
variation in the future that you didn't think to account for.  And its just
not scalable.  Consider the screen resolutions we have at this point:

320x280
280x320
480x320
320x480
480x800 (high density)
800x480 (high density)
480x854 (high density)
854x480 (high density)
480x800 (medium density)
800x480 (medium density)
480x854 (medium density)
854x480 (medium density)

And what could appear in the future?  Well here are just the typical screen
resolutions (and ignoring the impact of density):
http://en.wikipedia.org/wiki/File:Vector_Video_Standards2.svg

I would generally recommend approach this how we have done in the SDK:

1. Consider density independently of resolution: look at how to layout your
screen when just the density changes, but not the physical screen size.
2. Then different screen sizes, starting with the screen classifications
(small, normal, large) that have been defined.  First consider which of
these you care about supporting right now (for example large screens are
probably the least interesting at this moment), then about how your base
layout can adjust to the available space.

For example, if you are currently running on an HVGA screen, and want to
work on the upcoming high density screens.  First you'll want to deal with
the density change.  Just make sure your app still works, but doesn't use
the extra space (leave it empty at the bottom).  Then decide how you want to
take advantage of any extra screen space.  You may want to just center your
UI in it.  Or maybe have a 480x800 background that you use when there is
enough space for it, and is centered on a 480x854 screen.

As far as how to deal with this in resources, my first thought would be to
just have different distinct resources for the layouts of the actual
backgrounds you have.  These probably don't need to vary for density,
because density is just a scaling of the background (in fact maybe you just
want to let the platform scale the background for you at load time in some
cases).  So if you want to cover the vast majority of the upcoming cases,
you'd want a different layout for small screens, normal not-long (HVGA)
screens, and the two normal long screens (480x800 and 480x854 in high
density).

-- 
Dianne Hackborn
Android framework engineer
[email protected]

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