On Fri, Jan 7, 2011 at 10:32 AM, niko20 <nikolatesl...@yahoo.com> wrote:

> Hi, setting anyDensity to "True" tells android that YOU will be
> handling all density specifics, including supplying density specific
> graphics. In other words, it won't scale anything.
>

Not really.  The framework does a lot of things for you w.r.t. density --
converting dp units, scaling bitmaps, etc.  The "anyDensity" thing should be
considered only for backwards compatibility, for apps that were written
before there was any concept of density.  To make these work, the platform
puts the app in a special compatibility mode where everything (including raw
pixel offsets) looks like an mdpi screen.  This is not something that any
modern app should use, since while it does make old app works it also has
negative consequences such as slightly incorrect font metrics.


> > <supports-screens
> >        android:smallScreens="false"
> >        android:normalScreens="false"
> >        android:largeScreens="true"
> >        android:anyDensity="true" />
> >
> > My app currently only support the 480x800 screen size (I will be
> improving this, but that is how it is right now)  my question is:  Does
> android:anyDensity="true" mean Android will sort out the densities (despite
> the fact I have only provide 240dpi assets) or does it mean I need to
> provide assets for all known density classes?
>

Fwiw, what you are doing here is just going to make it so market will only
have your app available on devices with large screens...  which today
basically means only the Galazy Tab.


> > I want to support the Galaxy TAB - it is a large screen (600x1024) with
> density of hdpi, it turns out that my HTC desire  has a large screen
> (480x800) with a density of hdpi.  So these devices are indistinguishable to
> android as they fit into the same categories.
>

No, 480x800 hdpi is a normal screen.  You need to take into account screen
density.

I need to write up some documentation on the exact ranges for screen sizes,
but here is a rough summary:

- xlarge means the long dimension is at least 800dp and the short dimension
at least 600dp.
- large means the long dimension is at least 530dp and the short dimension
at least 400dp.
- normal means the long dimension is at least 470dp and the short dimension
at least 320dp.
- small means the long dimension is at least 426dp and the short dimension
at least 320dp.


>  Now the issue is that i designed it to look great on the HTC and now I
> have the Galaxy I want to fix it to look good on that too.  So the
> background image on the listView is 800 wide which looks great on the HTC
> but not so much on the TAB as it is centred and the icon that is on the left
> side on the HTC is blowing in the breeze on the TAB.  So I have some issues
> and I am really not getting anywhere.  So if anyone could point me in the
> right direction as to the proper process to follow to solve this I would be
> eternally grateful.
>

Trying to have a single big background image that matches the screen size,
if that is what I am reading you are doing, is probably going to cause you
endless trouble.  You want to either make that a 9-patch so it can resize,
or design the image so the whole image so that it can be resized to the
screen and still look good.

That said, I would *strongly* recommend staying away from these kinds of
background images, especially one behind scrolling things like list views:
they guarantee that your scrolling will never get a good frame rate.  There
is a reason why Android's standard UI doesn't use background images.  (Nor I
believe does the iPhone.)

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