Android Question Receiving Input from a bluetooth scanner to a textbox

RDCrozier

Member
Licensed User
Longtime User
Hi,

We currently have a stocktaking application which we are looking to streamline. Currently the order number is entered via an EditText, and this is looked up in a sqlite database. We have purchased a bluetooth QR code scanner and would like to use this to input the order number. The scanner connects to the tablet fine, and will output an order number followed by a return character in a native notepad application as well as Chrome etc.

When we perform the scan in the stocktaking application no text is output, however the EditText loses focus, and the FocusChanged event fires, so it is obviously picking up the return character. I have tried changing the Input Type from 'Number' as it was originally, to 'None', but that does not seem to have had any effect. I can't see any other properties which may hold the key here.

Within the scanner I have also tried slowing the read speed down as much as possible, in case the application was not running quickly enough to pick up the text being read in, no luck unfortunately.

It is also worth mentioning that the TextChanged event does not fire.

Any help greatly appreciated.

Thanks
Dave
 

MarkusR

Well-Known Member
Licensed User
Longtime User
just in my mind, its because multiline property in EditText?
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
my barcode scanner supports some bluetooth protocols.
  1. this one as keyboard emulator that always need a focus in a textbox. (i testet even with b4a at phone and it works)
  2. also Serial Port Profile (SPP) that can give you always data if you make a serial connection from within app.
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
Hi Markus,

Thanks for the reply.

The EditText is set to be singleline

That means that when the Scanner Sends the Return Character, the next logical field will be selected hence loss of focus after a scan. I would try setting with Single Line set to off. That way you can see if any data is being entered. I don't know why the field would be empty though.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
We have purchased a bluetooth QR code scanner and would like to use this
What model type and manufacturer is this? Do you have a link to the Documentation for this Hardware?
 
Upvote 0

RDCrozier

Member
Licensed User
Longtime User
Hi Guys,

Thanks for all the responses, just to give you an update of where were are at:

I created an application that was a layout with just an EditText box on it, and that worked fine with the scanner. I also tried the scanner in the stock-take application on one of our production tablets (around 5 years newer than the ones we currently use for dev) and this also worked without issue. I can only assume that what Syd suggested about other objects taking resources is what's going on here. (We have timers that check for wifi connections and also to check for new FTP files containing stock data, so I can only assume the very limited resources on our dev tablet are being used up elsewhere. I will play around with these timers and also try to ensure the EditText has focus for as long as is necessary.

Thanks again
Dave
 
Upvote 0
Top