15

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.

Vinayak Bevinakatti
  • 40,205
  • 25
  • 108
  • 139
  • The same basic tips apply to tablets as they do for phones. Try to avoid absolute values, and wherever possible allow android to dynamically position controls by using layouts correctly. Sorry to be a bit vague, but it's quite an open-ended question. If you have some more specific questions, I'll help if I can. I am covering some of this in an article on http://blog.stylingandroid.com which should be published within the next couple of weeks. – Mark Allison Apr 12 '11 at 10:38
  • Hi Mark, Thanks for your reply. As mentioned I am looking for multiple tablet screen support. For Example. If I have a image of 480x854 on 480x800 screen resolution then surely it will not fit correctly. By placing the 480x800 image in the correct folder will rectify this problem.Now my question applies to the same situation for tablets screens. – Vinayak Bevinakatti Apr 12 '11 at 10:50
  • hi. try to follow the UI guidelines of android .read this carefully http://developer.android.com/guide/practices/screens_support.html. and mainly use density independent pixels instead of pixels. – bHaRaTh Apr 12 '11 at 10:52
  • For bitmap images, they key thing is to be mindful of different resolutions. If you can use vector drawables or 9-patch images, then Android will do a much better job of fitting them to slightly different display sizes. It is important to stay away from designing graphics to precisely fit a, for example, 480x854 display, and design for a hdpi display instead. This same principle applies when scaling up to tablets. I have bumped the article I mentioned up the priority list (it deals with layouts rather than bitmaps, but the key principles are the same), and it will be published this Friday. – Mark Allison Apr 13 '11 at 07:17
  • http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts – narancs Sep 08 '11 at 08:38

1 Answers1

12

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

Community
  • 1
  • 1
Samuel
  • 9,883
  • 5
  • 45
  • 57
  • How to maintain the resolution of 1280*800 with above, do we need sw800? – Muhammad Umar Mar 30 '13 at 20:21
  • @MuhammadUmar, I guess it still falls under sw700dp check this [link](http://android-developers.blogspot.kr/2011/07/new-tools-for-managing-screen-sizes.html) – Samuel Mar 31 '13 at 12:33