Requestlocationupdates Mintime Parameter Purpose
Solution 1:
The minTime parameter doesn't fulfill its purpose, not even as a hint (Yea, a hint to 30 minutes update rate leads to more than update a second...). What does it do, then?
From Jellybean onwards devices must observe the minTime
parameter, so it does have a purpose (now).
Is there any other way to do it? I don't want the GPS to be enabled all the time because it will consume my battery too fast. Maybe I could schedule alarms repeating each 30 minutes, and call requestSingleUpdate?
Yes, use a Handler to request one update with requestSingleUpdate()
every 30 minutes.
I've tackled this before in a previous question, let me know if the code in that answer helps and if you have any questions it doesn't address.
Solution 2:
The second parameter, min distance difference in meters is set to zero, it causes constant updates. Prefer using requestSingleUpdate within a timer+handler on a desired period in minutes.
Post a Comment for "Requestlocationupdates Mintime Parameter Purpose"