Thats how the requestLocationUpdates looks like(the way I use it):
requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)
My question is if the logical connection between the minTime and the minDistance is OR or AND. If the minTime has passed will it wait for the minDistance or not?
OR or AND
The documentation on requestLocationUpdate()
says:
The minDistance parameter can also be used to control the frequency of location updates. If it is greater than 0 then the location provider will only send your application an update when the location has changed by at least minDistance meters, AND at least minTime milliseconds have passed
So both parameters must be satisfied before you'll receive an update if you specify non-0 values.
If you set minTime to 0, it will be called once when it first receives a location update, then it won't be called until you change your position in minDistance meters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With