Also unless you make your service foreground, its process *will* be killed every now and then while it is in the background.
And you can use the AlarmManager to avoid holding a wake lock the entire time, but a rate of once a second is way to fast to be appropriate for that -- scheduling Alarms should not be in terms of anything quicker than once a minute and really more like once every 5 minutes or more. On Sat, Jan 14, 2012 at 11:00 AM, Kristopher Micinski < [email protected]> wrote: > The way you should read mark's response here is: > > "Don't keep the cpu running, this is a dumb idea, if you're really > doing this it probably indicates there is something wrong with your > design" > > If this is *strictly* for development, and you'll completely strip out > the code when you release your app, it would probably be fine. > > kris > > On Sat, Jan 14, 2012 at 1:05 PM, Mark Murphy <[email protected]> > wrote: > > On Sat, Jan 14, 2012 at 1:00 PM, Dirk <[email protected]> > wrote: > >> Is there a way to control the device's sleep phases programmatically, > >> so I can make sure the logging really takes place ? > > > > Use a WakeLock to keep the CPU running. Your users may not like you > > much, though. > > > > -- > > Mark Murphy (a Commons Guy) > > http://commonsware.com | http://github.com/commonsguy > > http://commonsware.com/blog | http://twitter.com/commonsguy > > > > Android Training in NYC: http://marakana.com/training/android/ > > > > -- > > 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 > > -- > 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 > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

