public static void Update()
{
#if UNITY_EDITOR
// fake coordinates for the editor
Latitude = 34.020189;
Longitude = -118.288791;
return;
#endif
var unityPlayer = new AJObject("com.unity3d.player.UnityPlayer");
var activity = unityPlayer.GetStatic <AJObject>("currentActivity");
var manager = activity.Call <AJObject>("getSystemService", "location");
var location = manager.Call <AJObject>("getLastKnownLocation", "gps");
Latitude = location.Call <double>("getLatitude");
Longitude = location.Call <double>("getLongitude");
return;
/*
* if (history.Count >= 6) history.Dequeue();
* history.Enqueue(new Tuple
* {
* Latitude = location.Call<double>("getLatitude"),
* Longitude = location.Call<double>("getLongitude")
* }
* );
* UpdateAverages();
*/
}