Reputation: 476
Google Zxing expects an image. Can someone point me to how to make it work cleanly for live scanning (i.e. user points the device at a QR code and the scan happens; user does not have to take an image)? I've come across the following two aspects:
Other than Zxing are any other libraries to achieve the same for BB OS 5?
Thanks in advance
Upvotes: 5
Views: 852
Reputation: 28178
To use "live scanning" feature you need to use the Barcode API, which is a layer on top of ZXing only available in OS 6.0.
Here you have the official how to on Barcode API. In 5.0, you'll have to implement a custom mechanism based on VideoControl
. To implement a workaround, you could take snapshots periodically and try to decode them, or capture frames somehow from the video feed.
As the other answer says, in devices without autofocus, the FocusControl
will not work. In this case I suggest you to apply some zoom instead (using ZoomControl
class). This forces the user to move the blackberry away from the QRCode to be able to see it on the screen, thus increasing the definition of the captured image, which in turn increases the chances of detecting a barcode.
Upvotes: 1
Reputation: 19146
This library allows you to do live scanning on OS5. It works as an interface to the ZXing library.
Be warned, however that on OS5 devices FocusControl
is not fully implemented so scanning barcodes up close will be problematic. The workaround is to use VideoControl.getSnapshot()
which is the only way to force the camera to focus.
Upvotes: 4