How to Record Video from Background of Application:Android

Android - Recording Video in the Background

It turns out that Android doesn't like that the preview gets destroyed (when, for example, the user hits the "Home" button) so it cuts out video recording.

The workaround to this is using WindowManager to set an overlay and, when the user hits the "Home" button, resize it to 1x1. I found the solution here. Many thanks to cman!

Android recording video in Backround

You can use foreground services to use the camera in the background.
Foreground services keep running even after the Application is removed by the user from recents screen.

Make sure to read the restrictions applied by Android to these kinds of services:
https://developer.android.com/guide/components/foreground-services#access-restrictions



Related Topics



Leave a reply



Submit