Atif, the various layout classes are *intended* to be a generic
solution, making minor adjustments for minor changes.

Using different resource folders is intended for making major
readjustments to layout. If you design a good layout with the layout
classes, you may not need them at all!

Generally, separate resource folders are useful for when a particular
layout strategy simply breaks down when pushed too far. For example,
rotating to landscape may make the screen simply too short for one
strategy, but if you move a couple of things to the side, you're OK.

If you need to distinguish between 480x800 and 480x854 -- and
especially if it's 480x854 that has the problem -- then I would
strongly suggest that you take a close look at your layout strategies.
LinearLayout with some expandable padding elements, TableLayout, or
the use of a 9-patch instead of a fixed background graphic.

Android offers a lot of facilities for handling of layout differences.
I don't think they're always as easy to use and predictable as they
ought to be, but they're pretty rich and functional, none-the-less.

So if they aren't doing the job, and you're having to rely on
differentiating your layouts at the level of 480x800 vs 480x854, then
to get any help, you're going to need to precisely identify what
problem the layouts aren't handling for you automatically, and why.

My guess, however, would be that you're either:
1) Trying to put too much stuff onto each screen. This makes your
layouts very "brittle", and usually makes the result seem very
cluttered for the user, as well. There can be times when this is
appropriate -- for example, when the goal is a single-screen status
monitoring display. But generally, the strategy here should be to move
to less-cluttered, more tightly focused screens.

2) Trying to keep too tight a control on the layouts, rather than
defining a logical layout strategy, and allowing the system to make
the layout choices for you, within defined ranges. That does take both
a lot of understanding, and a lot of testing to identify the usable
limits of each layout strategy. But the result is that you won't have
to specify a new layout to handle some new device that adds another 54
pixels along one edge.

On Jan 26, 5:10 am, Atif Gulzar <atif.gul...@gmail.com> wrote:
> Thanks Dianne Hackborn,
>
> But then how one can set its single layout to work on all aspect rations. To
> solve the problem for long screens; I created a new folder layout-long and
> adjusted my lauouts. Wel it solved the problem for 480x800 but not for
> 480x854. Any generic solution ??
>
> --
> Best Regards,
> Atif Gulzar
>
> I ◘◘◘◘ Unicode, ɹɐzlnƃ ɟıʇɐ
>
> On Mon, Jan 25, 2010 at 11:06 PM, Dianne Hackborn <hack...@android.com>wrote:
>
>
>
> > Density and aspect ratio are completely unrelated.  Density is the size of
> > the pixels, and we currently only support square pixels (which is what all
> > current devices have as far as I know).  The aspect ratio is determined by
> > the number of pixels in th x and y dimensions, regardless of their density.
>
> > On Mon, Jan 25, 2010 at 7:04 AM, Atif Gulzar <atif.gul...@gmail.com>wrote:
>
> >> We can set the pixel values in custom views by multiplying them with
>
> >> this.getResources().getDisplayMetrics().density;
>
> >> This is ok when the screen aspect ratio is normal means not long
>
> >> But how can we set the pixels along Y-axis when the aspect ration is long.
>
> >> --
> >> Best Regards,
> >> Atif Gulzar
>
> >> I ◘◘◘◘ Unicode, ɹɐzlnƃ ɟıʇɐ
>
> >>  --
> >> 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<android-developers%2Bunsubs
> >>  cr...@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<android-developers%2Bunsubs 
> > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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