Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,619 Members 52,247 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Android Layout / Activity Select via Hardware Detection?

Tip us?
 
russ6100
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Jan 2014
Default [Q] Android Layout / Activity Select via Hardware Detection?

Hi all,

First post here - looking forward to participating and working hard towards competency in Android development!


In the short time that I've been at this, I've noticed a great emphasis put on the importance of building a layout that will work across a range of Android hardware, or at least work well with both phones and tablets.

From what I've seen so far, the way to deal with this challenge is to compromise, and to not use absolute sizing for views etc..

I'm wondering if there is any kind of API available that would make it possible to detect hardware (at least screen size?) upon start up, which would then allow for switching to the appropriate XML layout?

I've not encountered it in any of the tutorials I've seen so far....

If this API *doesn't* exist, I would guess that the fact that the apps run on a VM might make any kind of hardware detection problematic if not impossible....

I'd appreciate any enlightenment on this that I can get!

Thanks in advance!
 
russ6100
Old
#2  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Jan 2014
Quote:
Originally Posted by russ6100 View Post
Hi all,

First post here - looking forward to participating and working hard towards competency in Android development!


In the short time that I've been at this, I've noticed a great emphasis put on the importance of building a layout that will work across a range of Android hardware, or at least work well with both phones and tablets.

From what I've seen so far, the way to deal with this challenge is to compromise, and to not use absolute sizing for views etc..

I'm wondering if there is any kind of API available that would make it possible to detect hardware (at least screen size?) upon start up, which would then allow for switching to the appropriate XML layout?

I've not encountered it in any of the tutorials I've seen so far....

If this API *doesn't* exist, I would guess that the fact that the apps run on a VM might make any kind of hardware detection problematic if not impossible....

I'd appreciate any enlightenment on this that I can get!

Thanks in advance!
OK to bump?
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes