Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use front and back Camera at same time in Android [duplicate]

I want to use front and back Camera of device both at same time. In my app, first half of the screen will display preview of back camera and next half of the screen will display front camera preview.

I have tried this with setting two different camera previews but when I open my app, first half of the screen(which displays back camera preview) does not display the preview. And second half of the screen(which displays front facing Camera) displays back facing Camera(strange).

According to Camera.open(int) documentation:

Your application should only have one Camera object active at a time for a particular hardware camera.

This means if both camera hardware (front and back) are different and can be opened at same time.

In my application, I am using the same above api. This does not give any exception or error when I open and call Camera.startPreview(); for both cameras at same time. But still it is not working. I can see only one camera preview at a time.

Is there anything which I am missing here to use both cameras at same time?

like image 761
AndroDev Avatar asked Sep 12 '12 06:09

AndroDev


1 Answers

I got simultaneous dual camera access working on the HTC ONE M8

Video: http://youtu.be/lt8N1Lpa9Zw
Feel free to use my code from here: https://bitbucket.org/jens_grubert/androiddualcameracapture/

like image 157
jens.grubert Avatar answered Sep 28 '22 18:09

jens.grubert