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