I am developing an Android game that uses an orientation sensor to get the device to rotate (to roll the ball). I have two devices on which I am testing applications, one is Samsung Infuse (phone) and the other is Asus Eee Pad Transformer TF101 (tablet).
The application works in landscape on both devices. The problem is that on the Eee Pad, orientation is measured using the device sideways (landscape mode), while Infuse measures vertically (portrait) no matter what I do. This makes the ball move to the left when I tilt my Infuse to the left, but when I tilt the Eee Pad to the left, the ball moves up or down.
I can switch orientation angles, so they move the ball differently, but it only works for one or the other at a time. Any ideas how I could fix this?
Yes, I'm using the deprecated TYPE_ORIENTATION, not the getOrientation () method. I tried to configure it, but I never worked correctly, and it always gave out really strange values, so I stuck to the outdated one. Would switch to fix it? If so, can someone link me to resources to implement this?
source share