In order to create an application to keep track of the device 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.
- In iOS, if the developer wants to do background tracking it is necessary to include the 'location' value to the Background Modes property.
Geolocation - Show points near me
Geolocation - Showing My Location
Geolocation external object
Tracking using Silent Notificaction