Skip to Content
Platform.Ontology

Magnetometer and compass heading

Reads magnetic field and heading; iOS true heading uses location services.

Gets silentlyLocation and motionMotionAndroid and iPhoneWhile you use it

In one line

Can use your phone's compass and magnetic field, with a location link for true north

Reads magnetic field and heading; iOS true heading uses location services.

Reveals orientation and nearby magnetic objects (cars, metal), and is used for indoor positioning.

What it can and can't do

What the user does: Nothing, or you allow location when a compass wants true north on iPhone

It can

  • Measure the magnetic field in microtesla
  • Show compass heading toward magnetic north
  • Give true north on iPhone after location is allowed
  • Help find nearby metal or detect a magnet case

It cannot

  • Show true north on iPhone without location access
  • Give your location from the compass
  • Ask you first on Android; no prompt is used

How it differs between platforms: Android needs no prompt for magnetic readings. iPhone raw heading works, but true north needs location services.

On Android and iPhone

AndroidiPhone
StatusSupportedPartial
First versionAndroid 1.5 (API 3)iOS 4.0
Permission or entitlementNot listedprompt
Protection levelnoneprompt
How access is grantednonenone
What the user seesNot listedNot listed
How long it lastsNot listedNot listed
How to take it backNot listedNot listed
Store policyNone listedNone listed
APISensor.TYPE_MAGNETIC_FIELD, TYPE_ROTATION_VECTORMagnetic heading raw; true north needs location
NotesField strength 25 to 65 microtesla typicalNone

Data you get

What comes back: Field vector, heading
Shape: stream
How often: Up to 50 Hz

FieldTypeUnitRangePrecision
fieldfloatmicrotesla-2000 to 2000about 0.1

Technical limits

  • Needs calibration

The story

What it is

An app reads the magnetic field, which powers the compass and can show nearby metal.

For you

You see it as a compass needle in a map or a sky app that points to the right star. Most of the time you never notice the app reading it. It can also help place you inside a building.

For makers

Makers use it to turn maps to face your way, power AR and help find your spot indoors. It is a small fingerprint bit too, since each phone's compass has its own error.

Where you see it

TypeExampleApps
mapsA map app rotates the map to point the way you face while you walk.Google Maps, Apple Maps
ar-vrA star gazing app overlays constellations on the sky and follows your phone as you move it.Star Walk, SkyView
gamesAn AR treasure hunt points an arrow toward a hidden item.Ingress
travelA pilgrim or hiking app shows true north and a direction to a landmark.Qibla Finder
utilitiesA metal detector app shows spikes when the magnetic field changes near a pipe.None named
analyticsA tracker uses small magnetic quirks to tell phones apart, or maps indoor fields to find where you are.None named

Risks

  • Indoor position clues
  • Weak fingerprint bit

Android and iPhone in short

  • Android: Android apps read the magnetic field with no prompt.
  • iPhone: iPhone heading is available with no prompt, but true north needs location services.

What the platform says

Good uses and abuse

Legitimate uses

  • Compass

Known abuse

  • Fingerprint

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility2 of 5How useful it is to honest apps
Friction1 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

Same idea on the web

  • Magnetometer. Can sense the magnetic field around your device, like a compass

Sources

How well checked: Based on official documentation.

On this page