views:

136

answers:

0

When there is magnetic interference the built in heading calibration message is displayed. Also I noticed that if location is not available, magnetic heading is valid but not true heading. So what is the standard or best way to handle invalid heading updates? Should I just keep waiting for a valid heading to be received or show some custom animation? which is better?

// A negative value means that the reported heading is invalid, which can occur when the device
// is uncalibrated or there is strong interference from local magnetic fields.
if(newHeading.headingAccuracy < 0)
    return;

// A negative value indicates that the heading could not be determined.
if(newHeading.trueHeading < 0)
    return;