HowTo: Use Geolocation Tracking

Official Content
This documentation is valid for:

This document explains how to use Geolocation Tracking and provides a brief overview about it.

In order to create an application that keeps track of a device's position, it is possible to program a Panel object with three events (buttons):

The first allows to start the tracking points

Event 'StartTracking'
    Composite
        Geolocation.ClearLocationHistory()
        Geolocation.StartTracking(60,100,"",0)
        msg("Start")
    EndComposite
EndEvent

The second one allows to stop the tracking points:

Event 'StopTracking'
    Composite
        Geolocation.EndTracking()
        msg("Stop")
    EndComposite
EndEvent

At the end, the GeoPoints can be recovered with GetLocationHistory Method and it would be showed as an SDMAP grid: 

Event 'SetPositionsInMap'
    &locationCollection = Geolocation.GetLocationHistory(&Today)
Endevent

To download an example click  here.

Note that the tracking system can be expensive in terms of battery, so the tracking operations should be started and ended based on the specific needs of the application.

Note: In iOS, if you want to do background tracking, it is necessary to include the 'location' value to the Background Modes property.

See Also

Geolocation - Show points near me
Geolocation - Showing My Location
Geolocation external object
Tracking using Silent Notificaction