I'd like to test my app against large devices. I've got /layout-large/ folder and AVD(WVGA854) launching with -scale 160 dpi parameter, but for some reason it doesn't pick the right layout preferring /layout/ folder instead.
Asked
Active
Viewed 454 times
1 Answers
1
large means at least 640dp x 480dp, note "dp", not "pixels".
Your WVGA854 is 854 pixels so with 160 dpi you should get large (854dp which is greater than 640dp)
Are you sure you are launching with 160dpi? Are you using the eclipse plugin and launching from there, or the command line? Most devices with 854 are probably around hdpi (~240dpi) so make sure you are not getting any presets from that. Does it say screen size anywhere, that's a hint if so.
Also note that since Android 3.2 "large" etc are not the preferred way to do this: http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts In short, its now related to the width instead.

Mattias Isegran Bergander
- 11,811
- 2
- 41
- 49
-
yeah, but im building against api 10, I'm not sure whether it's present in supporting libs. And - yes I do use eclipse plugin in "Additional Emulator Command line Options" -scale 160dpi with current WVGA854. – May 02 '12 at 14:57
-
And there isn't something listed under the hardware options regarding lcd density? Could you try without the command line option and instead add/change the hardware option "hw.lcd.density" with a value of 160? http://developer.android.com/guide/developing/devices/managing-avds.html#createavd – Mattias Isegran Bergander May 02 '12 at 15:00
-
At 160dpi you have 1 to 1 mapping of device independent pixels (dip) to physical pixels (px): px = dip * (density/160) I quote "For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels." Read more: http://developer.android.com/guide/practices/screens_support.html – Mattias Isegran Bergander May 02 '12 at 15:37
-
1I tried to explain that in my answer. It is in the definition of "large device" which is at least 640dp x 480dp. At 160dpi you are over that limit but at 240dpi you are under (so not considered "large" any more). – Mattias Isegran Bergander May 02 '12 at 15:40
-
I have another topic http://stackoverflow.com/questions/10414100/screen-resolution-physical-size, but ill ask here - does "in the definition of "large device" which is at least 640dp x 480dp" mean that physically small phone with high dpi will be treated as "large device"? – May 02 '12 at 15:44
-
No, small != large :) That is exactly the intention and how it works (and how the math works out). So in short you have the resolution of the screen, and the size of the screen. That gets you the dpi (density). It's all explained here: http://developer.android.com/guide/practices/screens_support.html#terms – Mattias Isegran Bergander May 02 '12 at 15:50
-
Uhm, okay - would you mind commenting on this one please http://stackoverflow.com/questions/10414100/screen-resolution-physical-size/10416469#10416469 ? – May 02 '12 at 15:52
-
There is not much to comment there, before Android 3.2 that was kind of hard. Though you could perhaps assume android devices before android 3 to not be phone, all 3.x to be tablets and then you have it all covered. – Mattias Isegran Bergander May 02 '12 at 19:11
-
I added longer example as an answer on that question of how you could fallback on different layouts with some assumptions. – Mattias Isegran Bergander May 02 '12 at 19:25