I need to create a compass for my application.
From reading the documentation, there seem to be two reasonable ways to do this:
- Sensor.TYPE_ORIENTATION method: this is an easy way to do this. The problem is that this is not accurate. When I compare my reading with Snaptic Compass, it is about 10-15 years old, which is unacceptable for my purposes.
- Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD and getRotationMatrix () in combination with the remapCoordinateSystem () and getOrientation () methods: the documentation says that this is "usually more accurate". The problem is that regardless of the delay that I register with the listener, the compass goes crazy even when the device is on a fixed surface.
Any suggestions to resolve this issue are welcome.
source
share