7

Does anyone know the difference between the orientation sensor and magnetic field sensor on Android?

My understanding:

  • orientation => digital compass
  • magnetic field => magnetometer

Since I've read that magnetometer is synonymous with digital compass I'm a little bit confused. What are they really?

Kevin Montrose
  • 22,191
  • 9
  • 88
  • 137
devpg
  • 300
  • 1
  • 3
  • 10
  • 1
    good. I was looking for the same question and have little doubt. Now I am sure of it. – karim Nov 08 '10 at 13:46

1 Answers1

9

The magnetic field sensor is the compass.

The orientation sensor is a combination between the magnetic field sensor, and gravity sensors. It tells you the angle of the phone relative to the ground (pitch and roll) and the direction (compass).

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • 2
    Thanks a lot! This means orientation isn't a seperate sensor but a combined result of two others? The reason why a ask is that I wrote an app which calculates the orientation on two ways. 1) orientation sensor 2) magnetic field sensor + accelerator sensor The values aren't completly different but the second approach is much more accurate. Any guess why? – devpg Nov 02 '10 at 22:52
  • @Guffa, i doubt if accelerometer is really essential, since the data got from the magnetic field sensor is also in 3 dimensions, why cant it get yaw,pitch and roll just using the mag data? – zhangxaochen Mar 16 '13 at 04:55
  • @zhangxaochen: The magnetic field is a lot weaker than the gravitational field, so you get a more accurate reading from the accelerometer. – Guffa Mar 16 '13 at 10:43