Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Smallest Width Layouts

What are the primary buckets, or groups, of smallest width (sw) layouts that should be provided in an app?

I tried creating buckets around the most common screen widths in pixels: 240, 320, 480, 540.

Then I realized that the buckets are DP values, so a phone that is 480px wide is not (necessarily) 480dp wide. I had multiple 480px wide phones falling into my 320dp bucket and messing everything up.

So how do you handle this? Which groups do you use for choosing the right layouts in your Android phone apps?

like image 348
Studio4Development Avatar asked Jun 21 '13 20:06

Studio4Development


1 Answers

It depends on your needs. Generally smallest width is used for adapting your layout to different screen sizes. It is more precise than "small", "normal", "large", or "xlarge", but it has been introduced from level 13.

For smartphone I usually use "small", "normal" and "large" qualifiers because a lot of such devices are still below level 13. But for tablet I use sw600dp for 7-inch devices and sw720dp for more than 10-inch tablet.

like image 107
Donkey Avatar answered Oct 08 '22 06:10

Donkey