Hi
I'm finishing an app with a service module that successfully logs the accelerometer data, to record 3 axis movement when the phone is near vertical. I want to gather the horizontal accelerations of the phone while it is near vertical as part of a measurement system.
If the phone has been asleep, say flat on a table, for some time, on picking it up, without touching/unlocking the screen, the logging often takes time to start again. Perhaps a minute or more. I guess the CPU is being woken up and having to catch up with other tasks.
I have now implemented the PhoneWakeState.PartialLock to keep the CPU running. This works very well and the new data logging is instantaneous engaged when the phone is angled vertical.
One very undesirable outcome: Unfortunately, while the phone is back on the table, doing nothing, the battery is taking a wasteful beating because the CPU and accelerometers are running fulltime and being read non-stop. Any ideas on how to reduce the drain?
Somewhere here, I read that you could use sensors.initilaze2 to advise the CPU to scan the accelerometers slower and therefore reduce battery drain. But will this setting deny my higher speed data logging?
Thanks
I'm finishing an app with a service module that successfully logs the accelerometer data, to record 3 axis movement when the phone is near vertical. I want to gather the horizontal accelerations of the phone while it is near vertical as part of a measurement system.
If the phone has been asleep, say flat on a table, for some time, on picking it up, without touching/unlocking the screen, the logging often takes time to start again. Perhaps a minute or more. I guess the CPU is being woken up and having to catch up with other tasks.
I have now implemented the PhoneWakeState.PartialLock to keep the CPU running. This works very well and the new data logging is instantaneous engaged when the phone is angled vertical.
One very undesirable outcome: Unfortunately, while the phone is back on the table, doing nothing, the battery is taking a wasteful beating because the CPU and accelerometers are running fulltime and being read non-stop. Any ideas on how to reduce the drain?
Somewhere here, I read that you could use sensors.initilaze2 to advise the CPU to scan the accelerometers slower and therefore reduce battery drain. But will this setting deny my higher speed data logging?
Thanks