How to quickly find GPS location in Xamarin.forms?

I collect Latitude and Longitude Listview_ItemTappedwith a plugin Geolocatorto get the GPS location in xamarin.forms. But it takes an average of more than 15 seconds to capture a location. Is there any way to get location instantly.

if (CrossGeolocator.Current.IsGeolocationEnabled == false)
 {
    await DisplayAlert("Notification", "Geolocation is Unavailable ", "Ok");
 }
 else
 {
    Application.Current.Properties["LATITUDE"] = null;
     Application.Current.Properties["LONGITUDE"] = null;

    var locator = CrossGeolocator.Current;
    //locator.DesiredAccuracy = 50;               
    var position = await locator.GetPositionAsync(timeoutMilliseconds: 50000);

    Application.Current.Properties["LATITUDE"] = position.Latitude;
    Application.Current.Properties["LONGITUDE"] = position.Longitude;

    await Navigation.PushAsync(new RetailerDetailsPage(), false);
 }

I tried to remove it locator.DesiredAccuracy = 50;, but again someday it works instantly, and once it doesn’t exist.

+4
source share
1 answer

Yes, you can get a faster response, but it depends on your requirements.

, , , GPS, ( , , GPS,...) ..... , GPS .

Xamarin.Plugin Geolocator , , .

iOS RequestLocation CoreLocation, Apple " " . GPS, , . .

Android Google Play FusedLocationProviderApi (FusedLocationApi) GetLastLocation. ( , ).

Google, , Wi-Fi (SSID-based) ..

, , , Xamarin.Plugin Geolocator / .

, , , , - , "" GPS (, , ), ...

+5

All Articles