The best way to continuously monitor your location

I want to regularly track a user's location, such as Google Latitude. Something that wakes the phone every X minutes, even if the application is currently not working, get the location and send it to the server. This is what the user will have to choose.

Using LocalManager is not like the way to go. I guess this is kind of the following question: LocationManager updates every minute, consuming a lot of battery power

Using a combination of AlarmManager and LocationManager seems to work.

What is the best way to do this?

+6
source share
2 answers

I tried just using the LocationManager for this and didn't have much luck. Therefore, I looked at the LocationPoller , which, in combination with your own _WAKEUP should handle this scenario.

+3
source

Have you explored the possibility of writing a service to handle this?

I would be a little worried about the batteries, so I would do an “X” configuration if that is appropriate

+1
source

Source: https://habr.com/ru/post/887053/


All Articles