Veeru
Veeru

Reputation: 71

Enabling Camera LED alone without Camera.open in Android?

Is it possible to enable only LED of the device without using Camera.open() in Android?

Since LED light is also a separate hardware in mobile, there should be way to access it alone without using Camera.open() and setting Torch parameter to it.

The reason why I am asking is I have a Video App which is built in AIR which requires Flash to enabled with Camera also. The Camera will be made open by AIR and Flash will be enabled using Android Native extension. But its not working as we cannot have multiple camera instance opened at the same time.

Upvotes: 1

Views: 1721

Answers (1)

Sean Owen
Sean Owen

Reputation: 66881

No, you need to open the Camera with Camera.open() and then setFlashMode() to FLASH_MODE_TORCH to enable the LED light continuously. The LED is supposed to go off when the Camera is closed. And you need to close the Camera when your process goes into the background. So you really can't do this in a second app.

How about using ANE to call setFlashMode()? That would really be the right way to do it. I have never tried it directly so do not know if there's a catch that stops it from working.

Upvotes: 1

Related Questions