user270811
user270811

Reputation: 1751

Programmatically set layout for android

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 trackball 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.

Upvotes: 1

Views: 1084

Answers (2)

m6tt
m6tt

Reputation: 4223

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

Upvotes: 0

Stephen Denne
Stephen Denne

Reputation: 37057

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.

Upvotes: 3

Related Questions