• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps [Q] Microphone stops recording when screen times out

I'm writing an app part of whose functionality is to record audio through the microphone. The recording seems to stop as soon as the screen times out and the phone enters what I think is sleep mode. I've noticed that some apps(Tokasiki's Voice Recorder, for one) don't seem to have this problem on this phone(Motorola Atrix) and continue to record audio long after the screen has faded to black. I've tried using a partial wake lock but it doesn't seem to maintain the recording. Should I use AudioRecord instead of MediaRecorder? Voice Recorder seems to get by without using AudioRecord.
Anyone have experience with this?

Thanks in advance,
Raj
 
you may want to look at wakelock specifically - PARTIAL_WAKELOCK there are other state flavors as well choose the one that you need.
 
you may want to look at wakelock specifically - PARTIAL_WAKELOCK there are other state flavors as well choose the one that you need.
Actually PARTIAL_WAKELOCK is the one I need. I was just setting it up incorrectly. It seems to be working now. Thanks.
 
Back
Top Bottom