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
Adt Doesn't Create Default Hello World But Command Line Does
How to Modify Ripple Color When Using Attr/Selectableitembackground as Background
Convert Time Value to Format "Hh:Mm Am/Pm" Using Android
Can't Upload Updated APK to Google Play Due to Different Certificate
Connecting Android with Ms SQL Server 2008
Findviewbyid() Returns Null for Views in a Dialog
How to Correctly Pass Unique Extras to a Pending Intent
Android Device Does Not Show Up in Adb List
How to Use the Proguard in Android Studio
How to Use Data-Binding with Fragment
How to Blur Some Portion of Image in Android
How to Open the Options Menu Programmatically
How to Create Always-Top Fullscreen Overlay Activity in Android
How to Run Opencv Code Without Opencv Manager
How to Programmatically Launch a Specific Application
Android What Permissions Required to Call Powermanager.Gotosleep(N) Put Device in Sleep Mode