Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android layout: distinguishing an 800x480 large device from a 1024x600 tablet

Is there a way using Android layout to automatically distinguish between f/ex a Dell Streak with 800x480 resolution, and a Galaxy Tab or HTC Flyer with 1024x600 resolution? They all (presumably including the Flyer) report as -large (unlike the Xoom which reports as -xlarge). Is there a better layout tag than -large?

(Edited to clarify that -xlarge is no use in this case)

like image 611
Kenton Price Avatar asked Mar 18 '11 14:03

Kenton Price


2 Answers

See the "Table 2" in Supporting Multiple Screens and try to combine Size and Density qualifiers together. Also useful application ScreenInfo

Еxample:

Nexus One (480*800, 240 dpi) - "layout-hdpi" (normal screen, high density)

Samsung Galaxy Tab(600*1024, 169 ppi/dpi) - "layout-large-mdpi" (large screen, medium density)

Dell Streak(480*800, 186 dpi) - ??? (normal/large? screen, medium/high? density)

enter image description here

like image 172
iBog Avatar answered Nov 16 '22 00:11

iBog


For a tablet the xlarge screensize was introduced in API9. So if you want a special layout for xlarge(tablets) screens you'd put it in a layout-xlarge directory.

like image 22
Robby Pond Avatar answered Nov 16 '22 01:11

Robby Pond