Reputation: 31
I am using locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
in Android.
If I set minimum time = 120000 and distance = 10000, if user moves 11000 meter in 60000 millisecond, then location changed function will execute or not?
I want to know then when the onLocationChanged()
function is called.
Maybe something like:
or:
Upvotes: 2
Views: 2637
Reputation: 4139
whichever is first comes than location changed called, if distance is not complete and time going than location changed called or time is not going but distance has gone than called.
Upvotes: 0
Reputation: 1218
the minTime is used get the updates (this is why they recommend you set it above 60000ms)
Background services should be careful about setting a sufficiently high minTime so that the device doesn't consume too much power by keeping the GPS or wireless radios on all the time. In particular, values under 60000ms are not recommended.
The actual handler is also called when either
The reason the minTime is there is for background application to not eat all the battery.
Upvotes: 1