Set Mock location on Android
In geolocation testing on a TC56 device, Android Agent is not getting set as mock location app.
"Select mock location app" setting in developer options is also disabled, I have attached a screenshot for the same.
I am trying to access the script and show a dialog based on it.
Below is code snippet which I used to set mock location.
function MockGPSLocation()
{
var Longt, Lat, Alt, Acc, Gps;
// Enable GPS
Mobile.Device().GPS.GPSEnabled = true;
// Enable the "Allow mock locations" property
Mobile.Device().GPS.AllowMockLocations = true;
Longt = 174.8367068133983;
Lat = -36.87015422083155;
Alt = Mobile.Device().GPS.Location.Altitude;
Acc = Mobile.Device().GPS.Location.Accuracy;
// Specify a mock location
Mobile.Device().GPS.SetLocation(Longt,Lat,Alt,Acc);
// Output the location data
Longt = Mobile.Device().GPS.Location.Longitude;
Lat = Mobile.Device().GPS.Location.Latitude;
Alt = Mobile.Device().GPS.Location.Altitude;
Acc = Mobile.Device().GPS.Location.Accuracy;
Gps = Mobile.Device().GPS.GPSEnabled;
Log.Message("Longitude: "+Longt);
Log.Message("Latitude: "+Lat);
Log.Message("Altitude: "+Alt);
Log.Message("Accuracy: "+Acc);
Log.Message("GPSEnabled: "+Gps);
// Disable mock locations
Mobile.Device().GPS.AllowMockLocations = false;
}