How to better support multiple screen size


In this tutorial i will show you how to make your apps to feet better on more device’s screens. Usually our projects are based on 4 layouts:
  • Layout-small (0dp to 470dp)
  • Layout-normal (471dp to 640dp)
  • Layout-large (641dp to 960dp)
  • Layout-xlarge (961dp and bigger)

Now i will show you a more specific way of fitting device screens based on „dp” and the newest information about the screen size of the manufactured
devices.

What is dp
dp (dip) – Density-Independent-Pixels – an abstract unit based on the physical density of the screen.

Divide device screens into dp groups and create layout folders
Basing on the android devices resolution i managed to create 5 dp groups and tested them on different devices. Results where awesome.
  • 360dp - Small screen devices
  • 450dp - Bigger devices
  • 600dp - For 7" devices
  • 720dp - For 10" devices
  • 800dp - For bigger devices
Now that we know how to classify screen sizes, lets just change usual layout folders:
  • layout-sw360dp
  • layout-sw450dp
  • layout-sw600dp
  • layout-sw720dp
  • layout-sw800dp
And that's all. Remains to arrange layers in each folder and to test your app.

No comments:

Post a Comment