06-05-2013 02:26 AM
I am using the BarcodeScanner component to scan barcodes. So far, everything works fine and the barcodes are successfully scanned and decoded.
Now, we would like to add the feature of turning on the camera flash by pressing a button while the barcode scanner is working. This would help in scanning 2d barcodes in dimly lit areas (one of our use cases is for check in to different venues, like a bar or dimly lit restaurant)
Below is the sample code
//decoder and barcodeDecoderListener are previously initialized, and scanning a barcode is successful
BarcodeScanner scanner = new BarcodeScanner( decoder, barcodeDecoderListener );
FlashControl flashControl = (FlashControl) scanner.getPlayer().getControl("javax.microedition
But this does not turn on the flash. If I use the standard method to capture video (as in the demo app), then I can turn on the flash for video recording. But it does not work when using the BarcodeScanner component.
Any ideas? Or is it not possible when using the barcode scanner? Is it only possible when using the video camera recorder?
PS: I have also tried to instantiate a new camera player for recording in addition to the barcode scanner, but it seems only one component can open the camera at the same time.