Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android Hardware Profiles

 
Mark Beavis
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there -

Since the Android platform will be installed on a wide variety of phones/hardware configurations - I was wondering what support Android has for this.

For example - can it support a phone that does not have a screen that toggles between a landscape and portrait bias - and if so, how easy is it to write apps that degrades nicely for this hardware config.

Also - what is the minimum hardware spec that android can run on?

Thanks - Mark
 
Ed Burnette
Author
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no minimum spec that I know of. You can design your program so it will work on touch or non-touch, qwerty keyboard or numeric keypad or no keys at all, trackball or d-pad or wheel, portrait or landscape, gps or no, sensors or no, and so forth.

One of the main ways Android enables this flexibility is through "alternate resources". You can create different screen layouts, background images, help text, strings, etc., based on the UI language or hardware configuration on the device. For example in the Sudoku sample program in the book I have a stack of several buttons on the main screen that looks fine in portrait mode but you can't see all the buttons in landscape mode. So in landscape mode I use two columns of buttons. The regular layout is defined in res/layout/main.xml and the landscape mode layout is defined in res/layout-land/main.xml. No code change was needed.

http://d.android.com/guide/topics/resources/resources-i18n.html#AlternateResources goes into much more detail about how this works and where the "-land" suffix comes from.

For more detail on handling hardware capabilities see:
http://d.android.com/guide/topics/manifest/activity-element.html#screen
http://d.android.com/guide/topics/manifest/activity-element.html#config
http://d.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)
http://d.android.com/reference/android/location/LocationManager.html#getProviders(android.location.Criteria,%20boolean)
http://d.android.com/reference/android/hardware/SensorManager.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic