Pregunta

El uso de la opción de luz frontal con el escáner de códigos de barras de zxing1.6 no funciona en mi Nexus One.Necesito poder usar la linterna en mi aplicación, pero no puede tener dos instancias de la cámara en funcionamiento.¿Hay alguna manera de usar la linterna sin acceder a la cámara?¿O puedo acceder de alguna manera una cámara que ya está en uso?

Estoy usando el parche Google GreneCodicEtGode para poder escanear códigos de barras.

¿Fue útil?

Solución

The short answer is "no"; the front LED is controlled as a flash mode, which is a property of the camera. It is mode "torch". And no two apps can't open the camera at the same time.

(A longer answer is that there used to be a hidden API for this, which is what Barcode Scanner tries to access, but it doesn't work on almost any device anymore. You can dig into the source code to see FlashlightManager.)

Since Android 2.x there is this proper API for turning on the light, and the beta of the next version of Barcode Scanner does use it. You can try it here.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top