Esempio n. 1
0
        /// <summary>
        /// Click event to set the current location and update our server
        /// with the user's new geolocation information.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void mButtonSetLocation_Click(object sender, EventArgs e)
        {
            Location location = locationManager.GetLastKnownLocation(provider);

            userProfile.current_lat  = location.Latitude;
            userProfile.current_long = location.Longitude;
            Geolocation currentLocation = new Geolocation(userProfile.username, location.Latitude, location.Longitude);

            currentLocation.UpdateGeolocation(userProfile.token);
            Toast.MakeText(this, "Set Location Successfully", ToastLength.Short).Show();
        }
Esempio n. 2
0
 /// <summary>
 /// Click event to set the current location and update our server
 /// with the user's new geolocation information.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 private void mButtonSetLocation_Click(object sender, EventArgs e)
 {
     Location location = locationManager.GetLastKnownLocation(provider);
     userProfile.current_lat = location.Latitude;
     userProfile.current_long = location.Longitude;
     Geolocation currentLocation = new Geolocation(userProfile.username, location.Latitude, location.Longitude);
     currentLocation.UpdateGeolocation(userProfile.token);
     Toast.MakeText(this, "Set Location Successfully", ToastLength.Short).Show();
 }