I’ve just started using Appgyver to see if it would suit our company.
As a pilot project, I want to create an app for our Zebra TC20 PDA which contains a barcode laserscanner.
With this app I want to be able to scan warehouse location barcodes and through a REST API lookup list all the products and their quantities.
With help of some tutorials, I’ve managed to create this with the use of the software barcode scanner, included in Appgyver. I can scan the barcode with the camera, it will lookup the data and show it in a list.
However, the camera scanner is not very easy to aim at a larger distance or when there are other barcodes nearby. So I want to use the very acurate hardware barcodes scanner, which outputs just text.
What I want is a single input field on a page. When loading the page the focus will be immediately on the input field, so I can trigger the scanner and the text will be put in the field. Then the API call will be made to lookup data. When I just insert an input field I need to click it to allow input. Also it will bring up the keyboard, something I don’t want.
Is it possible to achieve this with Appgyver?
I’ve managed to get it working by using a On Page Focus event, focussing on a primitive input (don’t understand why this won’t work with a normal input) that has been made opaque and set to a height of 1px. Now it’s invissible and impossible to tap. This input is bound to a page variable that is being used in a regular input field. A flow to lookup the values hrough the rest api is bound to this field and is showing the output in a repeating container.
Tapping the regular input field will clear the page variable and will allow you to scan a new barcode. This will bring up a keyboard, so this will allow people also to enter a barcode manually.
The Zebra devices are equiped with software called Datawedge. This will allow you to modify the output text. I’ve configured it so, that a CR is added after each scan, mimicking te Enter/return press. This however doesn’t seem to do anything in the primitive field, but it does in the regular input field.
Only issue I’m still facing is, that when multiple barcodes are being scanned after page focus, those will be concatenated in the primitive field. The CR is ignored by that field.
Using the Datawedge software would also allow me to prepend the code with some characters (SD - ScanData). Would it be possible to create an listener event that triggers when keystrokes SD are detected?
I’m having the same questions, searching around for solution as well.