Forum Xamarin.Forms

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

SwuihparsoSwuihparso Member ✭✭
edited October 2018 in Xamarin.Forms

Hi,
I'm using Xamarin.forms (v 3.2.0.871581) with Cross.GeoLocator plugin (v 4.5.0.6) 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?

Answers

Sign In or Register to comment.