Android : App support for multiple tablet screen resolutions

Vinayak Bevinakatti picture Vinayak Bevinakatti · Apr 12, 2011 · Viewed 28.7k times · Source

I just ran my Android application on Galaxy Tab Emulator, where the design looks distracted. Now my worry is how to make the app fit perfectly on all the Tablet Screens. Since I came acrosss diffrent screen resolutions for Android Tablets. For example:

  • Samsung Galaxy Tab 10.1 3G - 10.1 inches, 1280 x 800 pixels
  • Samsung P1000 Galaxy Tab - 7.0 inches, 600 x 1024 pixels
  • Dell Streak 7 - 7-inch 800×480
  • Motorola Xoom - 10.1-inch, 1280×800
  • Viewsonic G - 10.1-inchs 1024×600

For small, medium, large .. screens Android provides specific layout and drawable folders. For tablets xhdpi and xlarge has been introduces. But still my question is how to make the design reliably compatible for all different tablet screen resolutions.

Look forward to your views/suggestions.

Thanks.

Answer

Samuel picture Samuel · Nov 16, 2011

I came across Using new size qualifiers in the Supporting Multiple Screens documentation.

According to this you can create folders like this

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10” tablets (720dp wide and bigger)

this in combination with the xhdpi folder should give more granularity.

UPDATE

i came across this as well, though this is off the topic I think might be useful in some cases

res/layout/mylayout.xml       # Default layouts
res/layout-v4/mylayout.xml    # Android 1.6 layouts
res/layout-v11/mylayout.xml   # Android 3.0 layouts

this link has a useful tip as well regarding using layout-v approach