I think you should try to avoid the situation where images mismatch between the layout.
I'm not entirely sure in what scenario you are seeing this, but for many uses of issues it should not be an issue, any more than say "text looks smaller than layout". For example an image that is the frame of a button or a check box or a lock or other icon: it just doesn't make sense of such an image to grow in size just because there is more room for your layout. The main place I see people having such an issue is when they use an image as a background, which I think because of the variety of screen sizes just ends up being fundamentally problematic on Android. Best is to simply avoid this, like the standard Android UI does. (And note having a background image has another big advantage: on most devices you can do 60fps scrolling in a list view and such when on a solid color; if you put your content on top of an image, there are very few devices that will still give you 60fps scrolling. It causes a huge performance hit, both to fill the background with the image, and because the content on top now needs to be blended with it.) If you absolutely want a background image to give your app more style, there are a couple ways you can do this: (a) use an abstract design, so you can scale the image to fit the screen you are running on (and be sure you pre-generate the scaled image at first layout or draw, or your frame rate will totally go in the dumper); or (b) use a 9-patch image that does some more intelligent scaling (though if the scaled parts are not a solid color, this is still drawing a scaled image, so if you just directly draw the 9-patch you have the same significant performance hit). On Wed, Jan 26, 2011 at 1:43 AM, Kostya Vasilyev <[email protected]> wrote: > Neil, > > I've only done Galaxy Tab tests with the emulator as well, so my > observations are somewhat limited, but still, here they are. > > The Galaxy Tab reports itself as an HDPI device, even though its actual > screen density is 170 dpi. This is to account for the larger display pixel > count, and greater viewing distance. > > Still, compared to a typical 4" 480x800 hdpi phone screen, the Galaxy Tab > can fit more on the screen, since it has more pixels: using a 72x72 icon as > a measurement unit, a 480x800 screen can fit 6.6 accross and 11.11 down. The > Galaxy Tab can fit 8.33 down and 14.22 across. > > This makes images look *smaller relative to the rest of your layout*, even > though they are *larger in real world units*, compared to a 4" hdpi phone, > and have *same pixel size*. > > The gist of all this is: I don't think you can expect an application > running on the Tab to look just like it looks on a phone, only larger. So > far, this has been the case for phones of varying screen sizes and > densities, but for a tablet device, this is no longer true. > > Now, if you want to have images in your application just for tablets, you > can use "res/drawable-large-hdpi", as phone screens are "normal" and tablet > screens are "large" (or possibly "xlarge", new in 2.3). But personally, I > found it more useful to focus on making sure that my layouts can be used in > landscape mode without vertical scrolling (sometimes creating separate -port > and -land versions to achieve this). > > Oh, and here is a table comparing the Tab to a 4" hdpi screen: > > Pixels Inches DPI Icon Icons/screen 480 2,06 233,01 72 6,67 800 3,43 > 233,01 72 11,11 > > > > > Pixels Inches DPI Icon Icons/screen 600 3,54 169,49 72 8,33 1024 6,04 > 169,49 72 14,22 > -- Kostya > > 26.01.2011 11:40, Neilz пишет: > > Hi all. > > I've got the Galaxy Tab emulator running, and was curious to see how > my various apps worked regarding layouts. I've looked at the various > docs on this, but they mostly talk about version 2.3 which I'm not yet > supporting. > > My apps generally currently specify: > > android:minSdkVersion="3" android:targetSdkVersion="8" > > and I have folders for res/drawable and res/drawable-hdpi, and just > the one res/layout folder. > > I notice that while the layouts fit nicely, the images are all too > small. So, bearing in mind my current spec above, what do I need to > add to make the apps compatible with tablets, without yet included 2.3 > support? > > > > > -- > Kostya Vasilyev -- WiFi Manager + pretty widget -- > http://kmansoft.wordpress.com > > -- > 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%[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

