Barcode Scanner Bridge passes scans from the device's built-in scanner to your web app in the browser. Each device needs Android 7.0 or later, a scanner that can broadcast its scans, a browser such as Chrome, Edge or Firefox, and a web app that uses the Barcode Scanner Bridge SDK.
Install, then open once
Install it from Google Play, or from managed Google Play with your MDM. Then open it once. Android doesn't start an app that has never been opened, so until then Barcode Scanner Bridge won't start when the device does, even when your MDM installed it. After that it starts at every boot and after every update, and Android can restart it if its process is killed. A force stop is different: you must open the app again.
Ways to open it after install:
- Your MDM's launch-after-install action, if it has one.
- Zebra StageNow, Android 13 and later (MX 14.0 and later): AppMgr, Action Turn On, App Feature Launch Application After Install, for com.procoit.barcodescannerbridge.
- Zebra StageNow, any version from MX 4.1: Intent CSP, Action StartActivity, package com.procoit.barcodescannerbridge, class com.procoit.barcodescannerbridge.StatusActivity.
- Your web app: a button that calls the SDK's openApp() opens Barcode Scanner Bridge and starts it. Chrome and Edge open it straight away; Firefox asks first. The same button gets it going again after a force stop.
Force stop (Settings > Apps > Barcode Scanner Bridge) stops it until it's opened again, as for any app. With Android Enterprise MDMs such as Microsoft Intune, deploy it through managed Google Play: apps that aren't in the policy are removed at the next sync, including one installed by hand.
Scanners
Set the scanner to send scans to Barcode Scanner Bridge instead of typing them. In the scanner's settings:
- Turn on broadcast (intent) output.
- Turn off keyboard (wedge) output. Otherwise each scan is also typed into whatever field has focus.
On a small screen, scroll tables sideways to see all columns.
| Scanner | Broadcast | Set up by |
|---|---|---|
| Zebra (DataWedge) | Intent output, action com.procoit.barcodescannerbridge.SCAN, delivery Broadcast | Barcode Scanner Bridge, with permission (below), or you |
| Honeywell (Data Intent) | Data Intent on, action com.procoit.barcodescannerbridge.SCAN, with category, package and class name left blank | You, in Settings > Honeywell Settings > Scanning > Internal Scanner > Data Processing Settings |
| Datalogic (Intent Wedge) | Intent Wedge on, with its default action com.datalogic.decodewedge.decode_action, category and extras, delivery Broadcast | You, in Datalogic Settings > Scanner & Decoder > Wedge, or with Datalogic's OEMConfig or Scan2Deploy |
| CipherLab (ReaderConfig) | Keyboard Emulation set to None, with the default Intent Action com. | You, in ReaderConfig > General Settings > Data Output (under Default Profile on newer models) |
| Point Mobile (ScanSettings) | device.scanner.EVENT: Result type set to Intent Broadcast | You, in Settings > ScanSettings > Basic > Wedge mode > Result type |
| Panasonic (Barcode Reader) | Intent output on, Intent action name com.procoit.barcodescannerbridge.SCAN, category left blank, delivery Broadcast intent | You, in the Barcode Reader app's profile > Intent output settings, or with TOUGHBOOK OEMConfig |
| Unitech (Android 10 and later) | unitech.scanservice.data: Scan to Key turned off | You, in Settings > USS > menu > App Settings |
| Sunmi | com. | You, in Settings > System > Scanner Settings > Data Output Mode |
| Bluebird | kr. | You, in BBSettings |
| Generic, Raptor, Wepoy, older Unitech (Android 9 and earlier) and others | android.intent.ACTION_DECODE_DATA (barcode_string) | You, in the scanner app's output settings |
| Urovo, RCV | urovo.rcv.message or scan.rcv.message | You, in the scanner app's output settings |
| Newland | nlscan.action.SCANNER_RESULT | You, in the scanner app's output settings |
| M3 Mobile | com.android.server.scannerservice.broadcast | You, in the scanner app's output settings |
| ZKC | com.zkc.scancode | You, in the scanner app's output settings |
- Where scans go. Each scan goes to the allowed web page in focus. If no allowed page is in focus, for example while another app is open, the scan isn't passed on, unless Scan wait time is set.
- Waiting for the first scan. Barcode Scanner Bridge can only check Zebra's settings. With other scanners, the notification says "Waiting for the first scan" until one arrives.
- Barcode types. Only Zebra, Honeywell, Datalogic, CipherLab, Point Mobile and Panasonic say which type of barcode each scan is.
Zebra DataWedge
Out of the box, DataWedge types scans into the browser. To send them to Barcode Scanner Bridge instead, it needs a profile for the browsers with intent output on. Barcode Scanner Bridge can create that profile, but it only changes DataWedge's settings with permission. Choose who gives permission with Scanner setup (scanner_setup):
| Scanner setup | What Barcode Scanner Bridge does |
|---|---|
| Ask the user on the device (ask, the default) | Nothing changes until someone taps Set up Zebra scanner on its screen and agrees to the change it describes. After that it updates the profile at every start. Remove Zebra scanner setup deletes the profile and withdraws the permission. |
| Set up automatically (automatic) | Your MDM gives permission. It sets up the profile at every start, without asking the device user. The app still needs to be opened once after installation. |
| Never: check settings only (never) | It never changes DataWedge's settings. It only checks the profile named in Scanner profile name and reports what's wrong. For admins who set up DataWedge themselves, with StageNow for example. |
The profile it sets up
| DataWedge setting | Value |
|---|---|
| Profile | Barcode Scanner Bridge (or your Scanner profile name), enabled |
| Associated apps | Every browser on the device (or your Browser package names), all activities |
| Barcode input | On, scanner selection Auto |
| Intent output | On, action com.procoit.barcodescannerbridge.SCAN, category android.intent.category.DEFAULT, delivery Broadcast |
| Keystroke output | Off, so scans aren't also typed into the page |
- Which browsers are included. By default, the profile covers apps that identify themselves as browsers to Android. Kiosk apps and launchers that also open web links, such as Kiosk Browser, are excluded so they keep their own scanner setup.
- Your own decoder settings stay. Each time, it sets intent and keystroke output, and only adds to the barcode settings.
- Browsers installed later are added to the profile, or reported missing when Barcode Scanner Bridge may not change it.
- Problems show on Barcode Scanner Bridge's screen, and the notification says "Scanner needs attention".
- A browser in another profile. DataWedge allows an app in only one profile. Remove the browser from the other profile, or list just the browsers you want in Browser package names.
- DataWedge's intent API access set to Controlled. Barcode Scanner Bridge doesn't send an access token, so DataWedge ignores it and the screen says DataWedge is not responding. Allow Barcode Scanner Bridge, or set Scanner setup to Never and set up the profile yourself.
- Removing the setup. Remove Zebra scanner setup deletes the profile. The browsers then fall back to DataWedge's default profile (Profile0): scans are typed into pages if Profile0 is enabled, and nothing happens if it's disabled.
- Uninstalling. Android doesn't let an app act on its own removal, so the profile stays behind and the browsers' scans go nowhere. Tap Remove Zebra scanner setup first, or delete the profile in DataWedge (or with StageNow) afterwards.
Allowed websites
Only pages from allowed websites can connect to receive scans. Set them with Allowed websites (allowed_origins) in your MDM, or on Barcode Scanner Bridge's screen on devices without one. Where your MDM sets them, the screen shows "Set by your organisation" and they can't be changed there.
| Entry | Allows |
|---|---|
| https://app.example.com | That website, on port 443 |
| https://app.example.com:8443 | That port only |
| https://*.example.com | Every subdomain of example.com, at any depth, but not example.com itself |
| app.example.com | https://app.example.com: an entry without a scheme means https |
| http://localhost:* | Any port |
| * | Every website. For testing only |
- Separate entries with commas, spaces or new lines. Page paths are ignored: allowing https://app.example.com/orders allows the whole website, not just /orders.
- Changes apply at once. Pages that are no longer allowed are disconnected.
- The test page (http://127.0.0.1:8766 with the default port) is always allowed while the test page is on.
- Pages on http. Allow them with the scheme, for example http://192.168.1.20:8080. In Chrome, pages served from a private IP address, a .local name or the device itself connect with no prompt. Public http pages are blocked. The address has to work on the devices themselves: an intranet name only your computers can look up won't. https is safer, as Chrome plans to check local network pages too.
Managed configuration
Add the app from managed Google Play, then set it up with your MDM's managed configuration. Most MDMs show the settings as a form.
Your MDM may call them:
- Microsoft Intune: App configuration policies
- Workspace ONE: Application configuration
- SOTI MobiControl: Managed App Config
- Android Management API: managedConfiguration
- Settings supplied by your MDM take precedence over settings on the device. Changes apply without restarting the app.
- To activate licences on your devices, send your licence key in Licence key.
| Setting | Key | Value | Default |
|---|---|---|---|
| Allowed websites | allowed_origins | Text: entries as above | None: only the test page |
| Scanner setup | scanner_setup | Ask the user on the device (ask), Set up automatically (automatic) or Never: check settings only (never). See Zebra DataWedge | Ask |
| Scanner profile name | scanner_profile | Text: the DataWedge profile it sets up or checks | Barcode Scanner Bridge |
| Browser package names | browser_packages | Text, comma separated, such as com.android.chrome, com.microsoft.emmx | Every browser on the device |
| Port | port | Number, 1024 to 65534. The test page uses the next port up | 8765 |
| Scan wait time (milliseconds) | scan_buffer_ms | Number, 0 to 10000: how long to keep a scan made while no page is in focus, for the next page to come into focus. 0 drops it | 0 |
| Test page | test_page | On or off: serve the test page on the device and allow it to connect | On |
| Licence key | licence_key | Text: activates the licence on each device (below) | None |
If you change the port, give your web app the same address: BarcodeScannerBridge.connect({ url: 'ws://127.0.0.1:8765' }), with your port number.
Browser permission
Chrome from version 147 asks before a public https page connects to an app on the device. Edge and Firefox also ask. Local http pages behave differently, as described under Allowed websites. The first time, the user sees a prompt asking whether the site may "access other apps and services on this device", and must allow it. Until they do, the page gets no scans.
- If they block it, the page can't connect until the permission is changed: in Chrome, ⋮ > Site controls > Permissions > Apps on device. Changes take effect without reloading the page.
- Edge shows the same prompt. Firefox has its own, and asks again on every visit unless Remember for this site is ticked.
On managed devices, allow your web app in advance with the browser's policy, and the prompt never appears. Chrome and Edge use the same policies, each set in its own app configuration in your MDM:
| Policy | Chrome for Android | Edge for Android | Value |
|---|---|---|---|
| LoopbackNetworkAllowedForUrls | 146 and later | 146 and later | ["https://app.example.com"] |
| LocalNetworkAccessAllowedForUrls | 140 and later | 144 and later | The same. The older name, still honoured |
Set both if your devices have older browser versions.
In Microsoft Intune
- Create an app configuration policy for managed devices, for the app Google Chrome.
- In the configuration designer, add Allow sites to make network requests to the local device.
- Enter the value as text, a list with the square brackets and quotes: ["https://app.example.com"]. Then assign the policy.
For Edge, create the same kind of policy for the app Microsoft Edge.
- Check that Chrome received the policy. After the device syncs, open chrome://policy and look for the policy with status OK. Delivery may take a few minutes.
- Intune's entry sets the older name, LocalNetworkAccessAllowedForUrls, which Chrome still accepts.
- Users can't block the site then: its permission shows as managed by your organisation. Remove the policy to see the prompt again.
- Firefox for Android has no such policy, as it can't be managed from an MDM. Users allow the prompt themselves, and tick Remember for this site so they aren't asked again.
- Pages in an iframe need the page around them to pass the permission on: <iframe allow="loopback-network">. Without it, the browser doesn't ask and the page can't connect.
- Policy names change. Google has renamed these policies before, so check the Chrome and Edge policy lists when you set them up.
Licence
- Trial. It starts the first time the app runs, and passes on every scan for 5 days.
- Licence key. Tap Enter licence key on Barcode Scanner Bridge's screen, or send it in Licence key from your MDM. Activation needs an internet connection. The licence is then tied to the device. Buy licences on the Barcode Scanner Bridge page.
- From your MDM, the key is activated in the background, whether or not the app's screen is open, and while the device is asleep. If the device is offline, it retries when it is back online, at most once a minute. If the key is refused (a wrong key, or no licences left), the screen shows why, and it tries again every hour for 3 hours, then once a day. A corrected key is tried at once. A device that's already licensed keeps its licence if the key changes.
- Without a licence, after the trial, web pages receive 25 scans a day, and further scans are not delivered. The allowance resets at midnight; scans withheld earlier are not replayed. The page in focus is told why each time, and the notification and screen say so too. Only scans that would reach a page count.
- Moving a licence. On a licensed device, tap the Licence card to deactivate it, so the licence can be used on another device. If your MDM supplies the key, remove it from managed configuration first. Then deactivate the licence on the device.
Battery and notification
- It keeps running. Barcode Scanner Bridge runs as a foreground service, so Android's battery saving doesn't pause it, and battery optimisation doesn't need turning off. Waiting for scans uses very little power.
- Screen off. Browsers can disconnect while the screen is off. The SDK reconnects after unlocking. If Android closes the browser, reopen your web app.
- The browser may close overnight, as Android closes apps left in the background. Barcode Scanner Bridge keeps running, and the page connects again as soon as it's reopened.
- Some makers stop apps more readily than Android does. If Barcode Scanner Bridge stops on such a device, exempt it from battery optimisation: with Zebra MX AppMgr's BatteryOptimization action, or Battery optimisation settings on its screen.
- Notification. On Android 13 and later, the status notification needs the Notifications permission. Grant it with your MDM's permission policy, or the app asks the first time it opens. It works without it; the notification just doesn't show.
Checking a device
- Open Barcode Scanner Bridge. Its screen shows whether the scanner is ready, the scanner setup, the pages connected and the last scan, with any problem and how to fix it.
- Tap Open test page under Tools, then scan a barcode. This checks delivery from the scanner to a browser. It does not check your own web app's SDK integration, Allowed websites entry or browser permission.
- The notification shows the state at a glance: "Scanner ready for web pages", "Waiting for the first scan" or "Scanner needs attention".
- Need help? Email [email protected].
Security and privacy
- Nothing off the device can connect. Barcode Scanner Bridge listens on 127.0.0.1 only.
- Only allowed websites connect. Browsers send the page's real address, and pages can't change it.
- Scans go only to the page in focus. Pages can't control the scanner.
- Barcode Scanner Bridge does not send scanned data off the device. The receiving web app may send it to its own servers. Barcode Scanner Bridge connects to the internet only to activate or deactivate a licence, and to send crash reports, which never include scanned data. See our App Privacy Policy.
- Other apps on the device. A native app can connect to Barcode Scanner Bridge, or read or send scanner broadcasts, as with any scanner's broadcast output. On managed devices, control which apps are installed.