My application needs to collect data from both sensors and GPS, but it seems that after I turn the screen off, the update rate slows down considerably (to 500ms, down from 20ms, or stops completely, in another phone).
I've read several workarounds: one of them involved using a wake-lock, to keep the process running, and another that says to register a broadcast receiver to re-register the event listeners after a screen-off event.
Both don't return errors while executing, but somehow the sensors stop behaving exactly after the screen turns off (and coincidentally, they start behaving right after I press the power button, nevermind unlocking the screen).
I'm registering the BroadcastReceiver from within an activity, to the "ACTION_SCREEN_OFF" event, an acquiring the wake lock from there aswell, on the 'onCreate'method.
I'm using a Lenovo A60 with Android 2.3.5, and an LG Optimus Pro with Android 2.3.4.
At this time, there are two possible answers to this question: