I've recently needed to create an App that uses a wired barcode scanner as part a Kiosk-style application in a public library. I wasn't sure what hardware might work with the Nexus tables that I wanted to use.
I'm pleased to report that I've got the following combination working:
Some notes on this:
I've got the scanner connected to a powered hub which is then connected via an OTG Cable to the tablet.
Currently this does NOT allow charging of the tablet, but there are (allegedly) connectors out there that work with some tablets. I've also spotted some cables that have a switch so that you can either charge the tablet or use the scanner. This is not very elegant though. I'm still researching this. If you have any known solutions to this then please post your results.
As a supplementary on this, when the BlueTooth keyboard is out of range, the device does NOT revert automatically to the virtual keyboard, you have to reselect it in the settings.
I had a serious problem with my code though in that it worked for a single scan then the Activity terminated with no error message. I suspect that this is something to do the messaging processes in B4A and I've found that the solution was to use a CallSubDelayed to let the system handle internal messages first.
That's where I am currently. Any comments/ideas welcomed.
Derek
I'm pleased to report that I've got the following combination working:
- Nexus 7 (2012) Tablet
- Zebra LS1203 Laser BarCode Scanner USB Kit with Stand
Some notes on this:
- Powering the tablet and the scanner is a key issue
I've got the scanner connected to a powered hub which is then connected via an OTG Cable to the tablet.
Currently this does NOT allow charging of the tablet, but there are (allegedly) connectors out there that work with some tablets. I've also spotted some cables that have a switch so that you can either charge the tablet or use the scanner. This is not very elegant though. I'm still researching this. If you have any known solutions to this then please post your results.
- Loss of virtual keyboard functionality
As a supplementary on this, when the BlueTooth keyboard is out of range, the device does NOT revert automatically to the virtual keyboard, you have to reselect it in the settings.
- Coding Issues
I had a serious problem with my code though in that it worked for a single scan then the Activity terminated with no error message. I suspect that this is something to do the messaging processes in B4A and I've found that the solution was to use a CallSubDelayed to let the system handle internal messages first.
B4X:
Sub txtNextItem_EnterPressed
CallSubDelayed("Scan","DelayedNextItem")
End Sub
Sub DelayedNextItem
Dim itemcode As String
itemcode=txtNextItem.text
Log("txtNextItem_EnterPressed with '" & itemcode & "'")
' ======== pROCESS THE iNFO HERE ======
AddBookInfo(itemcode)
log("Finished adding Item")
' Set field up for next scan
DoEvents
Try
txtNextItem.Text=""
txtNextItem.Enabled=True
txtNextItem.Hint="Add another"
txtNextItem.RequestFocus
Catch
Log(LastException.Message)
End Try
End Sub
That's where I am currently. Any comments/ideas welcomed.
Derek