Forum Xamarin.Forms

Location path in Xamarin forms problems related to background updates and consistency.

SwuihparsoSwuihparso Member ✭✭
edited October 2018 in Xamarin.Forms

I'm using Xamarin.forms (v with Cross.GeoLocator plugin (v in my xamarin.forms to fetch location whenever user executes a service. Like i want path user travelled from service start to service end. Path data are stored locally in sqlite db and syncing whenever service stops.
Data are saving fine but capturing data is problem since consistency is not available.

Sometimes some points are missed or location service is stopped in between(happening is some phones).
I'm trying this Geolocator with Listener settings(see below), but some path points are not captured at all(checked this DB).

ListenerSettings listenerSettings = new ListenerSettings
                                    AllowBackgroundUpdates = true, ActivityType = ActivityType.Other, DeferLocationUpdates = false,
                                    DeferralDistanceMeters = null, ListenForSignificantChanges = false, DeferralTime = null, PauseLocationUpdatesAutomatically = false
            await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(10), 0, true, listenerSettings);

How to achieve consistency during capturing location like every 5-10 seconds?


Sign In or Register to comment.