You shouldn't be thinking about dpi at all.

You will currently encounter devices with only 5 densities: 120, 160, 213,
240, 320.

Every device will have one of those densities; 217dpi and 220dpi are not
valid densities.  You will care about this pretty much only for your
graphics, though the platform will scale your graphics if it does.

This is also relevant for text sizes and units used in layouts, but in
those cases you just use "sp" or "dp" units and it is taken care of for
you.  So for your layouts you should basically not care about densities at
all, just do your layouts in "dp" units as if you were on a medium density
screen and let the platform take care of it for you.

I strongly discourage the use of other units like "in" and "mm" -- many
devices do not report the correct true physical density, so you
unfortunately can't count on them working correctly.  Fortunately you
shouldn't need to, because 99% of the time you want to be operating in
density units not true dpi.

On Thu, Jun 7, 2012 at 12:44 PM, Tommy Hartz <droi...@gmail.com> wrote:

> Hey everyone, I am a little confused on something. I have created multiple
> layouts for different screen sizes. The problem I run into is that on my
> HTC
> Inspire I have a "normal" screen with ~217dpi, on the droid X it reports to
> have a "normal" screen but it has ~220 dpi. When I run my app it pulls the
> right layout but the images on the screen have huge spaces in between them
> yet on my HTC everything appears how it should. How can I avoid this issue?
> It is incredibly frustrating.
>
> --
> 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
>



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