I want to use both front and back cameras at the same time. I have used two surface views. I have tried to implement the code in following answer.
The problem is that the camera API is now deprecated and the code was too old. I tried using the Camera 2 API in the same way but the camera instance won't open and i get a blank white screen. I get the following two errors:
Camera 0 not available! java.lang.RuntimeException: Fail to connect to camera service
Camera 1 not available! java.lang.RuntimeException: Fail to connect to camera service
What i wanna do is capture picture from front and back camera simultaneously on a button click. But i'm not able to open both front and back cameras at the same time. Is there anything that I do to use both cameras at same time?