On Wednesday, May 9, 2012 9:40:20 PM UTC-7, Kristopher Micinski wrote: > > > What you're doing isn't draining the battery only because of the > service, but also because of the location updates you'll be getting.. > GPS fixing is definitely the main battery killer here, but there are smart ways to handle it.
> 30-40 seconds, do you really need that kind of accuracy? I would say > that I'd only want something like 5 minutes, which an AlarmManger > certainly could do (I believe, at least..) > Actually, I like to get accuracy of about 5-10 seconds when driving, less when walking. But 5 minutes would be basically useless. At 70 miles an hour, that's 6 miles between points. Even when hiking, I can make quite a few switchbacks and directional changes in 5 minutes. It all really depends on what you want out of a GPS tracker. I want a detailed log with great accuracy. I know battery life suffers, but when you're in a car, you can be plugged in, so that helps. And even when hiking, 10 seconds between fixes allows my phone to go for 8 hour hikes, so it's completely reasonable. I changed my app to run as a foreground service and so far that has made all the difference. It hasn't once been restarted in 3 hours. For some reason, I thought a background process would be less likely to be killed, but now I see that services that let the user know exactly what is going on by being in the foreground and being required to show a notification icon are more transparent and thereby more "trusted" by the OS. The one thing that I don't understand is WakeLock. I am running my service without a wakelock, the phone has been off for a few hours, and it is still logging GPS points. Should I assume that some other app (I am running Tasker and some other automation apps as well as CatLog) are keeping the CPU awake? Thanks for everyone's help. Little by little, I am getting a better grasp of what I am doing. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

