Thank you Mark ! Is there a way to control the device's sleep phases programmatically, so I can make sure the logging really takes place ?
Regards Dirk On 14 Jan., 18:48, Mark Murphy <[email protected]> wrote: > On Sat, Jan 14, 2012 at 12:43 PM, Dirk <[email protected]> wrote: > > I am writing a service which shall continuously log some sensor data > > over longer periods of time. For testing purposes the service shall > > log a static debug message once every second. Looking at the log file, > > after some time (usually 30min to several hours), the logging only > > takes place every 10 minutes, every half an hour or sometimes even > > only once an hour. When I connect the phone to my computer, the > > service starts logging every second again. > > That is because the phone is falling asleep. Users like it when their > phone falls asleep, as this maximizes battery life. > > > The service is started once the device completed its boot process (or > > once the corresponding activity is launched) using: > > > Intent serviceIntent = new Intent(getApplicationContext(), > > TestService.class); > > startService(serviceIntent); > > You do not need getApplicationContext() here. Please replace it with > the "this" object reference. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://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

