Android Question How to determine data entered or scanned

Ronald Berardinis

Licensed User
I need to determine if a barcode is scanned or data entered.
This is for handheld like Zebra MC3300 running Android 7.0.
In windows, I tested when someone started to type and then calculated the elapse time.
If longer that 1/2 second then the user entered the text.

Is there a better way?


Licensed User
If your way works, stick with it. On a related note: if your aim is to prevent users from manually typing barcodes, then bear in mind that a paste operation of copied text could be interpreted as a scan.

Looking at the device manual (I think):

there are two other methods that might work, assuming that the DataWedge scanner interface software/"driver" is being used.

1/ according to page 96, the barcode scanner has three output (send) methods:
- keystroke output
- intent output
- IP (network) output
and so perhaps you could use the intent or IP method. Presumably this would hide the barcodes from appearing on screen - bonus!

2/ according to page 121, the keyboard output method has options including:
- Prefix to data - Add characters to the beginning of the data when sent.
- Suffix to data - Add characters to the end of the data when sent.
and so you could use some non-barcodey hard-to-type character(s) to tag barcodes from the scanner

2.1/ another keyboard output option is:
- Send as hex - Set to send the data in hexadecimal format.
which might be useful if you don't want the user to see (human-)readable barcodes.

It should be possible to configure these items from your app, using intents.

Ronald Berardinis

Licensed User
thank you.
I will need to investigate.
The idea to send a character with the barcode scan is interesting.
Hiding the barcode is not a issue.
Just need to select certain prompts to be scanned only while other prompts can be entered or scanned.

thank you again.


Licensed User
ASCII 96 = backwards apostrophe, is a good one - discreet (small, unnoticed), benign, and even if someone did spot it on the screen, they'd likely misread it as a normal apostrophe.

If your app is for general use (eg, sale on Playstore) then remember that you can configure the scanner settings programatically using intents, rather than people having to muck around inside the DataWedge software.