I am trying to improve the layout for my game. The problem is that while I can create a
good layout for one android phone, it doesn't work for another, ie the track开发者_Python百科ball for MyTouch
is on the right side (landscape mode), but for the MyCliq, the DPad is on the left side. Is
there a way to programmatically set the layout based on which phone it is? Thanks.
While not being programmatic, nor phone specific, you can supply alternative layout resources that are automatically loaded depend on whether the devide has a DPad or a trackball.
If you really wanted to do it on a device specific basis, perhaps android.os.Build.DEVICE would help.
http://developer.android.com/reference/android/os/Build.html#DEVICE
I haven't tried it but perhaps it will help
精彩评论