The magnetic field sensor on your phone measures the magnetic fields along the three axis of the phone (x, y, and z). It is primarily used to determine the orientation of the phone. For example, the Google app and the Compass app use this sensor to determine which way is north. Just move around with your phone to test how well the magnetic sensor works.