Hello fellow Bubblers, isn’t it a lovely day?!
Well, if the answer to that is a resounding NO then I have something that will certainly (possibly) brighten it (assuming your app actually needs a barcode scanner, otherwise you’re out of luck and I can’t help you, sorry) which is a Barcode Scanner plugin that scans barcodes. Clever.
Using this plugin you can scan barcodes using any camera on your device.
In order to use the plugin you just need to add the BarcodeScanner element on to the page wherever you want the video preview window for the scanner, then you can change the following options within the plugin editor:
- Camera Type (Manual / Back / Front)
- Manual Camera ID (see below)
- Barcode Type (type of barcode to scan for, the ‘Auto’ option will detect the barcode type but may produce many false positives)
- Scans per Second (max number of scans per second)
- Locate in Image (whether to locate the barcode from an image / frame)
- Patch Size (density of the search-grid proportional to size of scanned barcode)
- Half Sample (operate on image scaled down)
- Stop on Detection (stop on detection of first barcode)
- Detection Beep (play a satisfactory “beep” sound on detection)
- Show Result Boxes (show bounding boxes for found barcodes)
- Detecting Box Colour (colour of boxes for barcode patterns that do not result in a code)
- Detected Box Colour (colour of box for barcode pattern that does result in a code)
- Detected Line Colour (colour of line drawn across centre of a barcode pattern that does result in a code)
- Save Image to DB (whether to save the image frame used to decode the barcode to the db in jpg format)
- Filename (filename to save into db)
Once the Barcode Scanner becomes active on the page it will enumerate a list of cameras on your device and this can be accessed via the ‘Cameras’ state. You can use the camera’s index (starting at 0) in this list to set it as a Manual Camera ID. Eg. Your cameras have been enumerated to the Cameras state as:
To start the Front camera you would set the Manual Camera ID to 0; the Back camera would be 1; and the External camera would be 2 (etc.). I have included an example of a way to select this within the demo app.
You can start / stop the scan easily in the workflow via an Element Action.
You can view a demo of this plugin in action @ https://barcode-scanner-plugin.bubbleapps.io
The plugin page can be viewed @ https://bubble.io/plugin/barcode-scanner-1597756110129x923822061821886500
Did I mention it was FREE, too? So why not give it a whirl and let me know what you think!