I´m having a problem using the plugin "Xam.Plugin.Geolocator 4.5.0.6" i get all the info that i want but the time stamp that it prints is like 6 days ago and i really don´t now why. See down here:
This is the code for output:
private async void PositionChanged(object sender, PositionEventArgs e)
{
(here i got other stuff but not related to this just some json that i will use later)
// output de teste------------------------
var positions = e.Position;
var output = "Full: Lat: " + positions.Latitude.ToString() + " Long: " + positions.Longitude.ToString();
output += "\n" + $"Time: {positions.Timestamp.ToUnixTimeMilliseconds().ToString()}";//atenção este add hora foi para retornar a hora de Portugal UTC +01:00
output += "\n" + $"Heading: {positions.Heading}";
output += "\n" + $"Speed: {positions.Speed}";
output += "\n" + $"Accuracy: {positions.Accuracy}";
output += "\n" + $"Altitude: {positions.Altitude}";
output += "\n" + $"Altitude Accuracy: {positions.AltitudeAccuracy}";
Debug.WriteLine(output);
}
}
And this is the one that start the event above showed:
public async Task StartLocAsync()
{
if (CrossGeolocator.Current.IsListening)
return;
await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(5), 10, true);
CrossGeolocator.Current.PositionChanged += PositionChanged;
CrossGeolocator.Current.PositionError += PositionError;
}
And this is the output:
09-18 13:15:42.052 D/Mono (32302): Found as 'java_interop_jnienv_is_assignable_from'. 09-18 13:15:42.178 I/Choreographer(32302): Skipped 35 frames! The application may be doing too much work on its main thread. [0:] Full: Lat: 25.422 Long: -170.084 Time: 1536750935000 Heading: 0 Speed: 0 Accuracy: 20 Altitude: 0 Altitude Accuracy: 0 [0:] Full: Lat: 25.422 Long: -170.084 Time: 1536750935000 Heading: 0 Speed: 0 Accuracy: 20 Altitude: 0 Altitude Accuracy: 0 Thread finished: #5
The time in the output is in unix, but when convert to the normal format date it display the day 12 instead of the day 18 that is today.
Thanks any help.