i need to create a barcode scanner app on a real scanner device which has a build in laser scanner.
The device is broadcasting a system intent with the scanned data as payload.
Is there any way to receive this data in a Corona based app ???
the problem is not the scanner tool, the problem is how to receive android intents.
As far as I undersood there is an system app running on the device which catches the hardware trigger (scanner) and
sends out an android intent as broadcast. If we where able to manage to receive any intent I am sure it would
from my little experience with Android intents, the only way I could get them to work was basically trial and error configuring the intent or intents, you can have more than one.
The reason a scanner is needed is to trigger the DataWedge intent and play with different intent configurations until your app either loads or is at least is shown as an option to open the payload in the list of apps presented in the dialog box. If the DataWedge app has a simulated trigger to send an intent then that would be all you need to proceed. I haven’t downloaded the app yet, so not sure where to find this feature.
I have looked through some of the DataWedge documentation trying to find the mimeType of the payload. It could be MSR or possibly NFC, I really don’t know.
If you had a scanner in hand, you may also be able to see the intent pass into the logcat?
I got lost reading the documentation, but it looked like you may be able to load your app into a profile in the DataWedge app as a recipient of the output, but I didn’t spend enough time to fully understand it. I was focusing mainly on associating an app with an intent and mimeType.
Most scanners have at least one sane option that’ll work with Corona
Either a keyboard emulation (many of them will do physical key events that work) which is a good idea generally unless you’re only supporting specific hardware as then you can stick an OTG cable in the usb port and put a normal usb scanner on
Or a TCP option which is fairly straightforward to implement, just listen on a socket and the scanner will connect to it and send the scanned code down it
Zebra TC200J certainly can do sending over a TCP socket
I already had this idea and tried to use that, but it only worked for me when I enter the IP Adress of the device in the Datawedge profil. I would rather like to enter localhost (127.0.0.1) here, because the app will later run on many devices and I dont want to have that much admin work to set up individual profiles on each and every scanner device.
Do you have any experiences on that. Do you use that feature ?
Again, if I enter the IP adress of the device in the Datewedge profil my App will receive the data and everything is fine, but when I enter 127.0.0.1 it will not receive any data.