Location client priority from setInterval, setFastestInterval and setSmallestDisplacement?

If

locationClient.setInterval(60*1000);  
locationClient.setSmallesDisplacement(10);       
locationClient.setFastestInterval(1000);   

then when will updates be called? If the user has moved 10 ms in 60 seconds, will location updates be called? Or if the user has not moved any distance within 60 seconds, can updates be received? If all properties are used simultaneously, which will be given priority?

I used them all in my application. But he worked well only when the displacement is 1 m and the interval is 30 seconds. And got stranger results when the offset is increased to 20 ms, while maintaining the same interval.

+4
source share
2 answers

I have the same situation as you. Interestingly, the Interval will be the first call to determine the offset, or the movement will start first.

If the user travels 5 meters in your case, and then returns to the original location 5 meters, then there will be localcleint update newlocation, or it will not, because the user will remain in one place, but traveled 10 meters

0
source

The value of 10mand 60 sec intervaland no fastestInterval. Google Play location services will try to determine the location of each 60 sec, if it was 10 meters, if so, then it will call onLocationChanged, otherwise it will drop this value.

fastestInterval = 1, 1 sec, , 10m, onLocationChanged

0

All Articles