Domanda

L'uso dell'opzione della luce anteriore con lo scanner di bar del codice a barre zxing1.6 non funziona sul mio Nexus One.Devo essere in grado di utilizzare la torcia elettrica nella mia app, ma non puoi avere due istanze della fotocamera in esecuzione.C'è un modo per usare la torcia senza accedere alla telecamera?O posso in qualche modo accedere a una fotocamera già in uso?

Sto usando la patch di Google IntentIntegrator.java per essere in grado di eseguire la scansione di codici a barre.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top