1. Because I originally planned a longer delay between wakeups. Something like "wake up once per hour, start gps with 10minutes and 500meters as parameters then stop gps to save on battery".
Now I could set it to "wake up every 30minutes, start gps, do a single reading then stop gps". In this case, should I consider a timer? I mean, there's no guarantee that a valid reading will happen, so I have to consider a way to stop the gps before "going to sleep". (this will avoid to repetively start gps without stopping it in between).
Or, instead of the timer, keep the counter and, although I record just the first valid reading, I stop the gps when counter reaches 3?
2. From the thread introducing the sticky service:
"A sticky service is somewhere between a regular service and a foreground service. Android will kill the process from time to time. However it will recreate it automatically (as soon as possible).
For example if you want to track the device location you can use this option. The service (together with the process) will be killed however it will also be recreated again."
PhoneWakeState will be easy on battery drain?
You need to use PhoneWakeState to prevent it from sleeping until it is ready.
On a second reading of your hint, do you suggest PWS for the short time needed to acquire a valid gps reading as a way to assure the OS won't kill the service while it was waiting for a location (after gps.start and before a gps.stop)? If not, can you explain better. Thank you.
3. What if I don't use neither sticky nor PhonewakeState? will the service be awakened anyway due to its StartAt feature?
udg