This feels the same as the implementation of multi-touch, where multi
is only supported on ONE view - so how do you easily convert an app to
use multitouch if you have custom graphics using multiple imageviews?
You can't! You have to now draw everything yourself in one view. What
should have happened is an app could have indicated it supported
multitouch, and then multiple messages would be send to corresponding
views. That makes it simple and intuitive. Now you have a mess to code
around instead..

I think that this layout sizing is the same thing - instead of simply
scaling up your app, and allowing you to replace images with high res
when necessary, android instead postage stamps your app, requiring you
to try and make a different layout to handle it.

This becomes difficult, for example, when you have a tablet that
reports itself like the samsung does.

As an example, so you make a layout with buttons, etc so it looks
right on a Droid. A droid is 480x845, hdpi. It's high density.
However, to avoid density issues, you define your button sizes using
DPI's - as RECOMMENDED in the layout articles on the developer site.
So you have a button that you define as 80 DPI for example.

The problem arises when you now get a device which still reports
itself as HDPI, but has a much larger screen size, which is what the
Samsung does - it reports itself as hdpi, but has 1024x600 pixels.
What happens is your button is still 80DPI, and shows the same size as
before, but the screen is now up to 2 times bigger in the X direction!
Leaving either a ton of unusable space, OR still making your layout
look small on a large screen. The problem is since android doesn't
scale your app to fit the screen size, there is no way you can come up
with a layout that will look "proper" on different screens. It may be
"functional" but you wont be able to predict at all what the layout
will actually LOOK like.

I may still just not "get" this but right now it really seems
convoluted to me. In my opinion what should have been a simple scaling
is now a complex affair.

-niko


On Sep 14, 8:43 pm, niko20 <[email protected]> wrote:
> I still don't see how you can effectively do any of this when a device
> can report itself as "normal" but with a DPI of 240, but it could
> still range from 480x800, to 480x845 - a difference of 85 pixels,
> which may cut off some of your images if you make a layout for 480x845
> and it displays on a 480x800 screen.
>
> I don't think you have to be resolution dependent of course, but I'm
> having a hard time putting my question into words. It just doesn't
> feel like this works right. I still think if android would have scaled
> everything up for you it would have been much easier to understand and
> use.
>
> -Brad
>
> On Sep 14, 5:50 pm, jtoolsdev <[email protected]> wrote:
>
> > I happened to hear from Samsung about a particular app they were
> > interested in having ready for the India release.  The app was 1.5
> > compatible and interestingly the ImageView bitmap scaled fine even to
> > WVGA 854x480 without any changes.  Guess that's why I never heard from
> > any users that it was postage stamp.  I bumped the target to 1.6
> > leaving 1.5 as the minSDK and check for the display width.
> > Fortunately this graphic is simple enough and I already had scaling in
> > the drawing routine.  If it the display is larger than 480 then it
> > doubles the size of the bitmap and draws accordingly.  This solves the
> > problem for a 1024x600 size emulator.  Again this is a simple layout
> > so I can get away with it.  Anyone see any holes in this approach?  I
> > can't imagine any screen widths between 480 and 600 pixels but who
> > knows.
>
> > BTW, when people change from 1.5 to 1.6 Target you may run into some
> > problems such as I offer the ability to backup the database file to
> > the SD card.  Under 1.5 that worked fine but requires a permission
> > with 1.6 for it to work.   There was an issue with SQL too on a couple
> > of other apps.
>
> > - Brian
>
> > On Sep 14, 12:56 pm, String <[email protected]> wrote:
>
> > > I've spent a good bit of today making a couple of my apps scale well
> > > to tablet size, so I'll chime in here.
>
> > > My experience currently is the following:
>
> > > - If your activity could benefit from a completely different layout
> > > for tablets (>5" screen), then do so, in a res/layout-large
> > > directory.
>
> > > Otherwise, make your existing layouts scale:
>
> > > - Use layout classes (like RelativeLayout and LinearLayout) which
> > > scale naturally.
>
> > > - Use 9-patch drawables liberally. It may be helpful to re-use your
> > > existing
> > > hdpi drawables for large configurations.
>
> > > - Use <dimen> resources in res/values-large to specifically target
> > > dimensions (like font sizes & margins) to tablets.
>
> > > I actually enjoyed the process, once I got into it... Creating
> > > emulator instances for the Dell Streak and Galaxy Tab, then making my
> > > apps look good on them one, was quite satisfying.
>
> > > String
>
> > > On Sep 14, 8:18 pm, niko20 <[email protected]> wrote:
>
> > > > I guess my problem is that if you look at the graph on
>
> > > >http://developer.android.com/guide/practices/screens_support.html
>
> > > > It only shows "large" as the 480-800 pixel medium density, and 480x854
> > > > pixel medium density.
>
> > > > So what I'm saying is it's still only considered "480x854" for
> > > > example. So if you designed a layout to look good and you made buttons
> > > > that were "70dip", then even on a larger pixel screen the buttons are
> > > > still 70dip ...so you end up with a big empty space.
>
> > > > I guess maybe to answer my own question, you would probably have to
> > > > set buttons to use relative layout commands instead of any specific
> > > > "size" such as dips or mm. So you would set the main parent to fill
> > > > the screen (fill_parent) and come up with your layout based on all
> > > > relative from that?
>
> > > > Thanks for the input!
>
> > > > -niko
>
> > > > On Sep 14, 1:44 pm, Dianne Hackborn <[email protected]> wrote:
>
> > > > > DroidX is a normal screen, larger screens like the 7" samsung are 
> > > > > large.
> > > > >  You can provide a different layout for large if that is what works 
> > > > > for you.
>
> > > > > On Tue, Sep 14, 2010 at 11:27 AM, niko20 <[email protected]> 
> > > > > wrote:
> > > > > > I've been studying the screen support of Android and yes, while it 
> > > > > > IS
> > > > > > flexible, I still don't see how you can support a "really large"
> > > > > > screen like the Samsung tablet is going to have. I think no matter
> > > > > > what you end up with lots of wasted real estate.
>
> > > > > > The problem is the Android doesn't automatically "scale up" your app
> > > > > > if you run in compatibility mode - rather, it fits it into a postage
> > > > > > stamp instead.
>
> > > > > > Because of this, how can you really make an app that will "never" 
> > > > > > have
> > > > > > some postage stamping at all, unless you use all 9patch drawables 
> > > > > > and
> > > > > > Absolute Layouts? (Well, you could draw the GUI yourself, which is
> > > > > > what my Reloop Sequencer does)
>
> > > > > > As an example, my drum machine app, Electrum Drum, has a certain
> > > > > > layout for the buttons and pads. Now, on a larger screen, it would 
> > > > > > be
> > > > > > nice to just make all the buttons and pads BIGGER. I need the same
> > > > > > layout relationships between all the elements though. Basically I 
> > > > > > just
> > > > > > want a "scaled" up version of the UI. Maybe I can achieve this with
> > > > > > 9patch drawables and relative layouts?
>
> > > > > > The issue is I could certainly make "large" graphical elements (if 
> > > > > > not
> > > > > > use a 9patch drawable) but there is no way for something, for 
> > > > > > example,
> > > > > > to know that hey, I have LOTS of space I can use. Let's say for
> > > > > > example, that you want a completely different layout on a tablet - 
> > > > > > say
> > > > > > you want more buttons, etc, on your layout now. You can't do it
> > > > > > because there is no way for the android app to "know" that this
> > > > > > "large" screen is actually larger than "large". A Droid X probably
> > > > > > reports itself as large, although the screen is only 4.x inches or 
> > > > > > so,
> > > > > > where you would not have room for those extra buttons. This is no
> > > > > > where near as large as 7" or 10", even at a pixel density of 170 or
> > > > > > 240.
>
> > > > > > I think the default behavoir would have been better to scale up 
> > > > > > images
> > > > > > in compatibility mode, and if the dev could provide higher res 
> > > > > > images
> > > > > > then it would use them of course (put them in the large high dpi
> > > > > > folders), but I don't see how a layout itself can scale correctly in
> > > > > > really large cases like a tablet.
>
> > > > > > We need some better explanation of how to handle these cases. While
> > > > > > the blog and the dev site touch on much of it, I still don't
> > > > > > understand how a normal app is going to be enabled to scale up 
> > > > > > easily.
> > > > > > It would have been easy if Android would have just "magnified" the
> > > > > > view, but it doesn't.
>
> > > > > > -niko
>
> > > > > > --
> > > > > > 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]<android-developers%2Bunsubs
> > > > > >  [email protected]>
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > > --
> > > > > 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