2012/5/10 William Kelley <williamtkel...@gmail.com> > > > > 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. >
You might want to read this too: http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html#Processes under "Process lifecycle" is a discussion of Android's five levels in the process importance hierarchy. > 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? > It's possible. Incoming data packets on the mobile data connections, if any, will wake the device too (Gtalk/ Gmail / IMAP IDLE mail, etc.) Not holding a wake lock does not guarantee that the device will not wake up (regardless of running apps, bludgeoning the user would be the only guarantee, anyway... :) ). -- K > > 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 android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en