Skip to main content

mobileCurrentHeading

Type

function

Summary

Returns the current heading of the device.

Syntax

mobileCurrentHeading()

Description

Use the mobileCurrentHeading function to find the current heading of the device.

Examples

get mobileCurrentHeading()
put mobileCurrentHeading() into theHeading

Value

NameTypeDescription

return

If heading tracking has been enabled the mobileCurrentHeading function returns an array with the following keys:

  • "accuracy": The maximum deviation (measured in degrees) between the reported heading and true geomagnetic heading. The lower the value, the more accurate the reading.
  • "magnetic heading": The heading (measured in degrees) relative to magnetic north. true heading - The heading (measured in degrees) relative to true north. If the true heading could not be calculated (usually due to heading tracking not being enabled, or lack of calibration), this key will not be present.
  • "heading": The true heading if available, otherwise the magnetic heading. x, y, z - The geomagnetic data (measured in microteslas) for each of the x, y and z axes.
  • "timestamp": The time at which the measurement was taken, in seconds since 1970.

command: mobileStopTrackingSensor, mobileStartTrackingSensor

function: mobileSensorReading, mobileCanTrackHeading

message: trackingError, headingChanged

Compatibility and Support

Introduced

LiveCode 4.6.1

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?