2

I want to access the front and back camera at the same time. Is this possible? From what I tested, this could not be done. It crashes if an application is already accessing the back camera and another app is trying to access the front camera.

I found few previous posting here but there is no answer to this:

Can we access at a time Camera in multiple application?

Open android Front camera and Back camera at the same time

But what I don't understand is why is there such a limitation?

Isn't front and back cameras are two different pieces of hardware?

Or can this be done and am I wrong?

Thanks In Advance, Perumal

Community
  • 1
  • 1
perumal316
  • 1,159
  • 6
  • 17
  • 36
  • This is an old good question, and it received a well-articulated answer timely. It is worth linking to some new developments in this area, e.g. [Using both front and back cameras simultaneously android](http://stackoverflow.com/a/28811277/192373) *(incidentally, this question was asked only month later, but got much more publicity)*. TL;NR: some devices circa 2015 let you access front and back camera at the same time, within the same old API. – Alex Cohn Oct 18 '15 at 05:21

2 Answers2

2

From the documentation:

Your application should only have one Camera object active at a time.

The camera module is switched to either the front or back-facing camera. There is no design to launch both of them at the same time. HTC has confirmed this here. Sorry.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • Thanks for the reply. Can I assume that this is a limitation by Android OS itself? How about other brands other than HTC? Should be the same right? – perumal316 May 21 '12 at 04:10
  • Probably. There are a bunch of threads on the internet that ask your same question, and I haven't come across anyone who has successfully achieved this. If it can't be done using the public API, I doubt there is a safe means of hacking your way around it either. – Alex Lockwood May 21 '12 at 04:14
  • Your application should only have one Camera object active at a time for a particular hardware camera. – akshay Mar 22 '16 at 07:45
2

The accepted answer is wrong.

You CAN have both at the same time. This is the actual line from that linked documentation:

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

Aen
  • 7,433
  • 3
  • 20
  • 21