void LocationMonitorHeading(int flag);

 

Turns heading monitoring on or off.

 

Return Value

 

None.

 

Parameters

 

flag

Setting to determine whether heading monitoring should be on or off.  (0 = off; 1 = on)

 

Remarks

 

LocationMonitorHeading() turns heading monitoring on or off.  When location monitoring is turned on, the user will be presented with an alert stating that the application wants to know the device's current location.  At this point, the user may opt to disallow location monitoring.

 

Heading monitoring is turned on implicitly by LocationGetHeading().  If you wish to turn off heading monitoring, it is up to you to do so.

 

NOTE: this function is effective on the device only.

 

Availability

 

Available in DragonFireSDK 1.4 and later on devices with a magnetometer.

 

Example

 

#include "DragonFireSDK.h"

 

int MyFont;

int HeadingText;

char TextBuffer[100];

 

void AppMain()

{

  LandscapeMode();

 

  // Begin monitoring heading

  LocationMonitorHeading(1);

 

  MyFont = FontAdd("Helvetica", "Regular", 24, 0x00FF00);

  HeadingText = TextAdd(10, 10, "Heading:", MyFont);

}

 

//===============================================

void OnTimer()

{

  float heading;

 

  heading = LocationGetHeading();

 

  sprintf(TextBuffer, "Heading: %f degrees", heading);

  TextSetText(HeadingText, TextBuffer);

  }

 

//===============================================

void AppExit()

{

 

}