Articles
Barcode scanning

Barcode scanner not typing into the browser on Android? How to fix it

The scan goes nowhere, lands in the wrong box, comes out jumbled or brings up the keyboard. Why the built-in scanner on Android handhelds misbehaves in Chrome and other browsers, and how to fix each problem.

You press the scan button on a Zebra, Honeywell or Datalogic handheld, the scanner beeps, and nothing appears in your web app. Or the barcode lands in the wrong box, comes out with characters missing, or the on-screen keyboard pops up over the page.

These problems all have the same cause, and most have a quick fix.

Why it happens

Out of the box, the built-in scanner on an Android handheld doesn’t hand barcodes to web pages. Instead, the scanner’s own app (DataWedge on Zebra, the scanner settings on Honeywell and Datalogic) types each barcode into whatever has the cursor, as if someone had typed it very quickly on a keyboard.

So the scan only arrives if the right box has the cursor at the moment of the scan, and the page keeps up with the typing. When either goes wrong, so does the scan.

First, did it beep?

  • No beep and no light: the scanner isn’t reading at all. Check it’s turned on in the scanner’s settings, and that no other app has taken it over (see below).
  • A light, but no beep: the scanner can’t read the barcode. It may be damaged, or its type of barcode may be turned off in the scanner’s settings.
  • A beep, but nothing appears: the scanner read the barcode, but the typing went nowhere. Read on.

The scan goes nowhere

Nothing has the cursor. Tap into the box, then scan. If the page has no box to type into, such as a list or a page of buttons, the typing has nowhere to go: see A page with nowhere to type.

The scanner isn’t set to type. Each maker has a setting for it:

  • Zebra: open the DataWedge app, then the profile for your browser (or Profile0 if there isn’t one), and check that Keystroke output is on. DataWedge chooses its profile by app, so a profile set up for another app doesn’t affect Chrome.
  • Honeywell: Settings > Honeywell Settings > Scanning > Internal Scanner > Default profile > Data Processing Settings. Check that Wedge is on. More about Honeywell scanners and web apps.
  • Datalogic: Datalogic Settings > Scanner & Decoder > Wedge. Check that Keyboard Wedge is on.

If scans are sent to an app instead (“intent” or “broadcast” output), that’s deliberate: an app such as Barcode Scanner Bridge set it up to receive scans directly, without typing.

Another app has taken the scanner. Some apps take over the scanner while they run, and nothing is typed anywhere else until they let go. If scanning stopped after another app was opened, close that app, or restart the device.

The scan lands in the wrong box

The barcode goes wherever the cursor is. If someone tapped another box, it lands there.

The scanner may also add a Tab after each barcode, which moves the cursor to the next box, so the next scan goes there. Turn it off in the scanner’s settings (on Zebra, under Keystroke output > Basic data formatting), or ask your developer to make the page put the cursor back in the scan box after each scan.

The keyboard pops up

Android shows the on-screen keyboard whenever a text box has the cursor, and it doesn’t know the typing comes from a scanner. It can cover half the page.

Your developer can stop it for boxes that are only scanned into, by adding inputmode="none" to them. People can’t type into those boxes by hand any more, so keep them for scanning.

Characters come out jumbled or missing

The scanner types very fast, and a busy page, or a page that reacts to each key, can’t always keep up. Characters arrive in the wrong order or go missing.

Slow the typing down with a short delay between characters: on Zebra, Keystroke output > Inter character delay. Use the lowest delay that’s reliable, as every scan then takes a little longer.

The page jumps or submits after each scan

Scanners usually add an Enter after each barcode, so a form submits as soon as it’s scanned. That’s often what you want. If it isn’t, turn it off in the scanner’s settings (on Zebra, Keystroke output > Basic data formatting > Send ENTER key), or ask your developer to handle the Enter on the page.

A page with nowhere to type

Many web apps scan on a page with no box at all, such as a stock list or a picking screen. Typing has nowhere to go there. The usual workarounds:

  • A hidden box that always has the cursor. It works, until something else takes the cursor: a button, a pop-up, or a tap in the wrong place.
  • On Zebra, “Send characters as events”. The page can then listen for scans wherever the cursor is. It’s still typing, though: your page has to tell scans from typing, and it only works on Zebra. How to use a Zebra barcode scanner with a web app explains it.

Stop the typing altogether

Every problem above comes from the scanner typing. Barcode Scanner Bridge stops it: it runs alongside Chrome, Edge or Firefox, takes each scan from the scanner and hands it straight to your web app.

  • Nothing is typed, so no box needs the cursor, the keyboard stays away and every scan arrives whole.
  • Your page gets the barcode type too, on Zebra, Honeywell, Datalogic, CipherLab, Point Mobile and Panasonic.
  • It works the same way on every supported make of scanner, and on Zebra devices it sets up DataWedge for you.
  • Your developer adds a few lines to the web app:
BarcodeScannerBridge.connect({
  onScan: function (scan) { console.log(scan.data, scan.sym); }
});

It’s £8.00 per device, once, after a 5-day free trial. For devices that only run your web app, locked down, Kiosk Browser receives scans itself, without typing, instead. On Honeywell devices only, Honeywell’s own web SDK is another way: see How to use a Honeywell scanner with a web app.

Still stuck? Tell us your device and what happens when you scan, and we’ll help.

Barcode Scanner Bridge

Hardware barcode scanning in any browser.

Find out more Get it on Google Play