-
Notifications
You must be signed in to change notification settings - Fork 2
Compass
Michał Gasztold edited this page Jul 5, 2017
·
3 revisions
The SDK uses built in motion and magnetic field sensors to calculate the compass bearing. To receive bearing updates in the mobile application an UbuduCompassListener has to be used:
mIndoorLocationManager.setCompassListener(new UbuduCompassListener() {
@Override
public void onAzimuthUpdated(float azimuth) {
// azimuth in a range from 0 to 359 degrees
}
});
Note: The magnetic sensor available in Android devices is not always accurate and demands simple calibration that can be done when the app is running:
-
Wave your phone in the air making a figure of 8 couple of times.
-
You may need to repeat the above until direction shown on your map display gets reasonable.
Image comes from support.google.com.