Ejemplo n.º 1
0
 public static void InsertLocation(Location Location)
 {
     using (var db = new SQLiteConnection(DatabasePath))
     {
         db.Insert(Location);
     }
 }
Ejemplo n.º 2
0
        private async Task<Location> GetCurrentLocation()
        {
            var geolocater = new Geolocator();

            var geoposition = await geolocater.GetGeopositionAsync();

            var location = new Location();
            location.Latitude = geoposition.Coordinate.Latitude;
            location.Longitude = geoposition.Coordinate.Longitude;

            location.Timestamp = DateTime.Now.ToUnixTimestampMS();

            // TODO: check accuracies here mean the same thing
            location.Accuracy = (int)geoposition.Coordinate.Accuracy;

            return location;
        }