How to measure the tilt of the phone in XY plane using accelerometer in Android
I tried to use the Z axis data from SensorEvent.values, but it doesn't detect rotation of my phone in the XY plane, ie. around the Z-axis. I am using this as a reference for the co-ordinate axes. Is it correct? How do I measure that motion using accelerometer values? These games do something similar: Extreme Skater , Doodle Jump. PS: my phone orientation will be landscape. Essentially, there is 2 cases here: the device is laying flat and not flat. Flat here means the angle between the surface of the device screen and the world xy plane (I call it the inclination) is less than 25 degree or