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

Turning screen off while video recording

ConceptVBS

Well-Known Member
Press the power button to turn off the screen while recording video. This way you dont accidentally hit the stop recording button.
 
On my machine (Galaxy S3), when I go to turn off the screen, it stops recording. It would really be helpful to battery life if we had an app developer make a feature to turn screen off and still be able to record. I'll pay 4 FRNs for it.. Throw in the ability to mute the camera when it takes a picture and I'll pay 5 FRNs.
 
So basically, its just something that runs in the background, including when the screen is off. Now, all you have to do, is put your recording code in a service. You may face a problem that your service gets killed by the system, as the android docs specify:

For more information read this article : http://www.learn-information-techno...ideo-recording-on-android-when-screen-is-off/


Note this means that most of the time your service is running, it may be killed by the system if it is under heavy memory pressure. If this happens, the system will later try to restart the service. An important consequence of this is that if you implement onStartCommand() to schedule work to be done asynchronously or in another thread, then you may want to use START_FLAG_REDELIVERY to have the system re-deliver an Intent for you so that it does not get lost if your service is killed while processing it.
 
Back
Top Bottom