There can be good reasons to use the px unit, even though they should
be pretty rare. AbsoluteLayout was deprecated to encourage developers
to use other layouts and have apps that behave as well as possible at
difference resolutions.

Also, the dp unit depends on the density of the screen, not the number
of pixels. AbsoluteLayout is a problem as soon as you change either
the density or the screen resolution. For instance, if you go from
320x480 (G1) to 640x480 but keep the same density (about 180 dpi), a
layout defined with AbsoluteLayout will not work properly. By using a
LinearLayout for instance, the layout will at least adapt to any new
screen resolution. It might look too big or too small if the density
changes, but at least it would be using the screen estate correctly.

On Fri, Mar 13, 2009 at 8:26 AM, Streets Of Boston
<flyingdutc...@gmail.com> wrote:
>
> I'm using the AbsoluteLayout in one of my apps and it can be useful.
> However, i think it'll be deprecated because the AbsoluteLayout is
> device(/screen) dependent. E.g., if a new phone comes out with a
> square screen instead of 320x480, your app starts to look funny. You
> can mitigate this somewhat by using 'dp' units, for example, instead
> of using 'px' units.
>
> Although, all other measures (e.g. widths of views) can still be
> expressed in pixels, which is device dependent as well.
>
> So, why will AbsoluteLayout become deprecated and not the measures
> expressed in pixels?
>
> On Mar 13, 11:15 am, Edward  Falk <ed.f...@gmail.com> wrote:
>> On Mar 12, 5:03 pm, Romain Guy <romain...@google.com> wrote:
>>
>> > AbsoluteLayout is deprecated in Cupcake.
>>
>> Why?  And what do we use in its place?
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

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