Reputation: 735
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?
Upvotes: 7
Views: 3932
Reputation: 1699
Take a look at Screen Sizes for a survey of device sizes. At first glance, 480px, 720px, and 768px appear to be the most common widths for phone displays.
Upvotes: 0
Reputation: 1206
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.
Upvotes: 3