I am trying to create a video recording app that will stay recording when the user changes the foreground app (I would show a notification icon in this case).
I am using Kickflip API for frame rendering, and from what I got from this post using a SurfaceTexture that is not bound to any views would get the job done.
This is the piece of code that implements the rendering, and as you can see the surfaceTexture is being created separately from any Views. This should be enough to allow for background recording, however this is not happening (audio is indeed still being recorded though).
Any ideas?
Do I need to create a Service for this? I've noticed that the Camera object is in fact still working when in the background, however the onFrameAvailable callback from SurfaceTexture.OnFrameAvailableListener is never called when not on the foreground...