Android Question Device rotation angle

DarkAngel

Member
Licensed User
Longtime User
I have a problem with screen/device rotation. I can detect where there was a rotation of the device.
The problem is I use a compass and the angle of North's not correct when screen is in a specific position or rotation.
When I turn it upside down then angle has 180º difference, but I have to add 90º when the device is rotated 90º.
The problem is that I cannot detect in the device's exactly position/rotation.
I would need to detect if the device was rotate 90º (right) or 180º (left), and in one of this scenarios the compass indicates a wrong north.
Adding 90º or 180º to the compass angle will solve the problem only in on of the above devices positions/rotations.
How can I detect the device rotation angle? like 0º 90º 180º 270º? and compensate to the compass north calculation angle.
 
Or he could have asked in the chat room and got the answer ;)
 
Upvote 0
Or he could have asked in the chat room and got the answer ;)
I really must try the Chat again but not now whilst I'm at work, only got another 5 minutes of lunch break remaining. :(
 
Upvote 0
Back
Top