×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2012.821 | Released: 23 May 2012, 2:01am | What's New | Download Now

system.setLocationThreshold()

Description:

Sets how much distance in meters must be travelled until the next location (GPS) event is sent. Because location events involve hardware that can drain the battery, using larger threshold distances preserve battery life.

Related Items:

Location Events

Syntax:

1
system.setLocationThreshold( distance )

Example:

system.setLocationThreshold( 100 )  -- fire the location event every 100 meters

Parameters:

distance

Location event distance (in meters). Defaults to 0 meters.

Returns:

Nothing.

Remarks:
Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    Corona SDK 1.0
  • Windows:
    Corona SDK 2.0
  • iOS:
    Corona SDK 1.0
  • Android:
    Build 2011.701