I am using Google's fusedlocationproviderclient to track location of user in real time on android using a foreground service. I have noticed some times fusedlocationproviderclient returns same locations multiple times in a row. As of now I am observing, sometimes fusedlocationproviderclient return very inaccurate location (Around 700m).
Earlier I used to track location using Location_Services but moved to fusedlocationproviderclient in order to reduce battery consumption. I have set fusedlocationproviderclient priority to High Accuracy. I have set minDisplacement to 100m.
This is my location object
private void createLocationRequest() {
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(10000);
mLocationRequest.setFastestInterval(10000);
mLocationRequest.setSmallestDisplacement(100);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
}
I am expecting it should return accurate locations. As I display tracked locations onto a static map die to incorrect location a straight line appears in map.