Method

GetLocation

ModuleMobile
LibraryCore
Action


Get the physical location of this device in terms of longitude, latitude and altitude.


Parameters(None)
Return values

Latitude (string): The latitude of this device as a value between 180.00 and -180.00 degrees. For example a latitude of 51.511658 equates to 51 degrees, 30 minutes and 42 seconds North.

Longitude (string): The longitude of this device as a value between 180.00 and -180.00 degrees. For example a longitude of -0.3130263 equates to 0 degrees, 18 minutes and 46.9 seconds West.
Altitude (string) : The altitude of this device in meters above the World Geodetic System (WGS) 84 reference ellipsoid, which is a mathematically defined surface that approximates to the figure of the Earth.
Example


 Mobile.GetLocation();


Platforms
  • Android, excluding Android 8+.
Notes

The Tachyon Agent uses the GPS and network providers to supply current location data. These providers differ in accuracy (especially for Altitude), power consumption (GPS provider is more energy intensive), and speed of location acquisition (network provider is faster). For full accuracy GPS Services should be enabled on the device.

Currently we subscribe to updates with a minimum interval of 1 second and a minimum distance of 1 metre. These figures will be revised should this configuration prove too CPU-intensive.

If both providers return locations then the most recent location fix is always preferred and returned by the method.