• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layout guidelines for phone/tablet app

 
gary fong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I've begun writing an app that I want to run both on my 10" tablet and 3.7" phone. Part of the screen will be 2D graphics and the other part a number of buttons. How does one go about reasoning which layout views to use and the proportionality of the various elements/views in the app? Do I just do the simple, possibly naive, big-to-little decomposition? How do I consider portrait/landscape in this mix as well?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For portrait/landscape you'd do the same as you would for any Android app: keep separate layout files for those layouts that need it in landscape mode. For example, if layout/main.xml is your main layout for portrait mode, create another one as layout-land/main.xml. The app will automatically switch to using if the device is flipped. See http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources for details. Unfortunately, "xlarge" (for 10") is supported only in Android 2.3 and newer, so that won't work if your devices don't have that. So you'd have to check the screen size programmatically, and choose an appropriate layout file based on that.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the practices advised and advertised for handling multiple screen sizes will still hold. Like using dip, scalable drawables(9 patch resources) etc.
This might be of some use.

Honeycomb's Preview SDK has new revamped widgets for tablets etc. you might want to also take a look at them(documentation is not available online but only with the download if I am not mistaken).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic