I am writting an application to tracks users real time location and show it on map. However the results I am seeing are not satisfactory. When I compare my app with others present on play store the difference is a lot.
Here are the things which I have tried so far: (Just in case I am using Xamarin to build this application)
I have earlier used Fused Location Api, this gave too much of deviation from users current location. So, I tried with Location Manager using only GPS_Provider. Using this the accuracy increased a lot but still not perfect.
Below is my code using location manager:
protected void CreateLocationRequest() {
if (locMgr.AllProviders.Contains (LocationManager.GpsProvider) && locMgr.IsProviderEnabled (LocationManager.GpsProvider)) {
locMgr.RequestLocationUpdates (LocationManager.GpsProvider, 3000, 2, this);
}
}
public void OnLocationChanged (Location location)
{
Console.WriteLine ("OnLocationChanged");
if(location != null && location.Accuracy <= 20){
drawPath (location);
}
}
Below is the screen shot of my application:
Below is the screenshot of an app from playstore