We are using Google Play Services to get location updates:
LocationRequest mLocationRequestHighAccuracy = LocationRequest.create()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setFastestInterval(500)
.setInterval(500);
FusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(context);
Task<Void> task = locationProviderClient.requestLocationUpdates(getLocationRequestHighAccuracy(context), getActivityDetectionPendingIntent(context));
task.addOnSuccessListener(new OnSuccessListener<Void>() {<snip>}
For some reason, most of the time, we only get accuracy of 10m.
BUT, if we register to LocationManager in android.location, we get accuracy of 4m and sometimes even 3m. Code snippet:
android.location.LocationManager locationManager = (android.location.LocationManager)
appContext.getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(android.location.LocationManager.GPS_PROVIDER, 500, 0, mLocationListener);
We want to use Google Play Services for its faster fix time, and the fusion with more sensors, but we need the most accurate result. I don’t understand how the fused location provider provides less accurate result than the gps provider.
Does anyone know how to force Google Play Services to give us more accurate results? Our only solution thus far is to register to both, get the lat/lon from Google Play Services and the accuracy from the raw GPS (if it’s lower).. But that seems like a hack…
Thanks.