Dianne,

I'm confused about the correct approach. With the release of the Dell
Streak, this question is coming-up more frequently. Al Sutton put up a blog
post about it too:
http://blog.alsutton.com/2010/07/03/android-tablets-and-mdpi-large

This is what I'm not clear on: suppose you have a UI design that calls for
an ImageButton that fills approximately half the screen. The geometry is
easily defined by combining layout_weight and fill_parent etc. The image
displayed in the ImageButton will cover approximately the same number of
pixels on say both the Dell Streak and the Nexus One. So how do we organize
our resources such that both of these phones will choose the same image
resource for the button, while at the same providing a smaller image for
devices such as the G1 (ie. a device that has far fewer pixels, but the
roughly same screen size as the Nexus One)?

Tom.

-- 
Tom Gibara
email: m...@tomgibara.com
web: http://www.tomgibara.com
blog: http://blog.tomgibara.com
twitter: tomgibara

On 4 July 2010 09:32, Dianne Hackborn <hack...@android.com> wrote:

> I am going to very strongly urge you *not* to do this.  And definitely
> don't do what was recommended by someone on the other thread you started,
> using the deprecated explicit size qualifier.
>
> What you are doing is going against the design of Android that is there to
> help applications deal with the variety of screens we have.  So not only are
> you fighting the platform, but you are setting yourself up to have a
> continual series of problems as you encounter different kinds of devices.
>
> Let's take this statement: "The Dell Streak being a high res device should
> have used the 480x720 imagery."
>
> Well...  no, that isn't the way it is.  The Dell Streak is a medium density
> large screen.  The Droid and other such phones are high density normal
> screens.  There are VERY different things, and you shouldn't be treating
> them as the same.  That is why the platform support identifies them as being
> different.  For example, the standard text size on the Streak is going to be
> smaller than on Droid...  because the Droid has a higher density screen, so
> a larger text size is needed to have the same effective physical size.  If
> you don't take this into account, you are either going to end up with a
> strangely huge UI on the Streak, or an unusably small UI on the Droid.
>
> Further, you really should not be creating a fixed size UI.  Just start
> with the number of screens you will encounter today: QVGA low density, HVGA
> medium density, WVGA (in two different sizes) high density and medium
> density, and you can be sure that more will be appearing in the future.  If
> you design your UI based on the platform facilities (densities, screen
> sizes, layout) then your app will nicely scale to all these screens with
> little work on your part.  If you try to treat the screen as a rigid size,
> you are going to set yourself up for continual pain.
>
> On Sat, Jul 3, 2010 at 9:27 PM, Stephen Lebed <srle...@gmail.com> wrote:
>
>> Hi Dianne,
>>
>> I wish I could share with you my source so you can see why its
>> necessary.  I've already tried various methods before settling on the
>> solution I have now.  My app now displays its custom graphics on the
>> G1, Droid, and Dell Streak's specs on the emulator.
>>
>> My app is a utility that uses rendered graphics to make the app look
>> nice.   I have imagery that is 320x480 for use on mdpi devices, and
>> imagery at 480x720 for use on hdpi and large devices.  My goal was to
>> create graphics that would not require resizing for the majority of
>> high res devices.  The Dell Streak being a high res device should have
>> used the 480x720 imagery, but instead used the images in the 'drawable-
>> mdpi'.  It was only after I created a 'drawable-large' folder with a
>> duplicate set of 480x720 images that the Dell Streak would finally use
>> them.  I could have worked it out so that the Streak would use the
>> graphics in the mdpi folder and just scaled them up to fill the
>> screen, but that would have been a bad solution for people capable of
>> displaying high resolutions.
>>
>> I also tried creating a 'drawable-hdpi-large' folder, but it wouldn't
>> work for some reason.
>>
>> I hope this makes sense and helps explain the issue I was having.  I
>> found that the resource aliasing only works from a 'drawable' folder.
>> I've copied all my high res images into that folder and I have
>> references in my 'drawable-hdpi' and 'drawable-large' folder.
>>
>> I believe it is a shortcoming of the way Android is designed where I
>> can't run the alias's from anything other than the 'drawable' folder.
>>
>> I understand the difference between screen sizes and dpi', I'm just
>> trying to find a simple way to make a device utilize graphics that its
>> capable of supporting.
>>
>> Thanks,
>> Stephen
>>
>>
>>
>> On Jul 2, 5:33 pm, Dianne Hackborn <hack...@android.com> wrote:
>> > Why do you want to do this?  The Streak's screen is really what it
>> reports
>> > -- mdpi density, but more space.  If you use hdpi graphics, then your
>> > graphics will appear incorrectly large on the screen.  You should layout
>> > your UI to use the extra space, not blow it up larger.
>> >
>> > The main time I can think where it would be okay to just use larger
>> graphics
>> > is a game, where having everything blow up bigger is not so noticeable.
>>  In
>> > that case, you should maybe just go down the path of picking the
>> graphics
>> > you want to use explicitly based on the raw space you have to work with.
>> >  Before going down that road, though, you should probably stop and
>> consider
>> > what it really means to be manually adjusting for whatever the screen
>> is.
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Jul 2, 2010 at 5:15 PM, Stephen Lebed <srle...@gmail.com>
>> wrote:
>> > > I'm hoping there is an answer to my problem.  I've created two sets of
>> > > graphics for my app.  A set for medium res phones and a set for high
>> > > res phones.  I've placed them into their drawable-mdpi and drawable-
>> > > hdpi folders.
>> >
>> > > I've now learned that the Dell Streak identifies itself as a large-
>> > > mdpi display.  I've created a drawable-large folder and placed the
>> > > high res images into it.  Its so far, everything is working in the
>> > > emulator.
>> >
>> > > My problem is I would like to create a single set of high res graphics
>> > > and have it availalbe to both drawable-hdpi and drawable-large.  I've
>> > > tried using the example in the docs
>> >
>> > >http://developer.android.com/guide/topics/resources/providing-resourc.
>> ..
>> >
>> > > but it doesn't seem to work.  I wanted to use drawable-hdpi to store a
>> > > single copy of all the high res images, and store the xml aliases in
>> > > drawable-large.  It compiles without error, but when my app tries to
>> > > read the drawable, it throws an error, Null Pointer Exception.
>> >
>> > > Does the alias xml file only work with images in drawable, or can they
>> > > be in a drawable-hdpi folder?  When I try to pull the file from
>> > > drawable-hdpi it causes the error.
>> >
>> > > Any help would be appreciated.
>> >
>> > > Stephen
>> >
>> > > --
>> > > 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%2bunsubscr...@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%2bunsubscr...@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%2bunsubscr...@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