• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

user interface in Android for smartphone for tablet

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I program an user interface in Android for smartphone, if I want this application on a tablet..... do I need to program another user interface?
 
Author
Posts: 16
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great question. I'll answer the best I can here, but feel free to follow up if it doesn't help.

Android's design strategy is great for tackling multiple size screens, as you can customize as much as you're able to, in order to provide the most customized and optimal experience for your users.

Typically, your interface files will be created as XML layout files in your resources directory. I'm attaching an image here from an Android app I'm working on today:



Here, I'm just getting started on Android tablet support. So I have our standard layout xml files, in default directory. I've then created two other directories to keep layout xml files as well, layout-sw600dp and layout-sw720dp. The first directory here will be referenced for devices larger than 600dp in width. The second folder will take over once the app needs to render it's interface on a screen 720dp or higher.

As you can see, we'll name the file the same and have it in the individual directories. So I can optimize my layout here for larger 600dp (think Nexus 7, smaller tablets), and very large 720dp+ (Nexus 10 like) devices.

For more info, see this great link! http://developer.android.com/training/multiscreen/screensizes.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic