Slightly better answer than mine :) On Sat, Oct 10, 2009 at 2:27 PM, Mark Murphy <[email protected]>wrote:
> > Jeremy Slade wrote: > > With all the new Android devices around the corner -- how do we > > identify what hardware the app is running on? Specifically for game > > development, I want to find out what input devices might be available > > (keyboard, trackball, dpad, etc), and possibly even how things are > > layed out -- dpad on the left or right, only accessible w/ the > > keyboard open, etc. > > > > So does the API already provide any way to do that? Identifying the > > phone model would be a start, but I'd rather not have to maintain a db > > of phone models and their hardware features. > > If there are hardware features you have to have, there are elements you > can put in the manifest to declare what you need: > > > http://developer.android.com/guide/topics/manifest/supports-screens-element.html > > http://developer.android.com/guide/topics/manifest/uses-configuration-element.html > > http://developer.android.com/guide/topics/manifest/uses-feature-element.html > > If there are hardware features you can live without but want to use if > they are available...I suspect that will be on a feature-by-feature basis. > > If all you want to do is change up layouts and such for keyboards and > the like, you can use resource sets to help with that: > > > http://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources > > In terms of identifying the phone model, android.os.Build is what you'll > want -- BRAND, DEVICE, MODEL, and such should give you what you need. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Android Development Wiki: http://wiki.andmob.org > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

