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 resoluti开发者_JS百科on? 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)
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)
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.
精彩评论