質問

zxing1.6バーコードスキャナでのフロントライトオプションの使用は、Nexus Oneでは機能しません。私は私のアプリで懐中電灯を使うことができるが、カメラの2つのインスタンスを実行することはできません。カメラにアクセスせずに懐中電灯を使用する方法はありますか?それとも、すでに使用されているカメラにアクセスできるのかどうか?

Google General IntentIntegrator.javaパッチを使用してバーコードをスキャンできます。

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top