Industry problems

How do rugged Android handhelds keep working offline?

A rugged Android handheld keeps working offline when the app on it does not need a live connection to finish a task. On Zebra devices, DataWedge hands each barcode scan to the app as an Android intent, the app saves the scan on the device and queues it for upload, and device-to-device software can pass records to nearby handhelds when no network reaches either one. The fleet and the app's settings are rolled out with StageNow, MX, OEMConfig and an EMM.

TL;DR

Reading a barcode needs no network, so a rugged handheld keeps working offline when its app treats local storage as the record. On Zebra devices, DataWedge delivers each scan as an intent, the app saves it and queues the upload, and device-to-device software moves records between handhelds. StageNow, MX and an EMM deploy the app and its settings.

Learning objectives

After reading this article you will be able to:

  • Explain how DataWedge intent output delivers a barcode scan to an Android app
  • Describe how a handheld app keeps scans through a dead zone and passes them between devices
  • Identify how StageNow, MX, OEMConfig and an EMM deploy and configure an offline-capable app

Rugged Android handhelds and dead zones

A rugged Android handheld keeps working offline as long as the app on it can finish a task without a live connection. Zebra and other makers build these mobile computers for warehouses, yards, stores and field work. They run Android, carry a built-in barcode imager, and are managed as a fleet rather than as personal phones. They also work where coverage is patchy: Wi-Fi can end at the dock door and cellular drops behind concrete and steel, as How do warehouses and yards handle dead zones? describes.

Reading a barcode needs no network, because the identifier is printed in the label. The network is needed for the step after it, sending the scan to the warehouse or store system. So whether a handheld keeps working offline comes down to how the app receives scans, where it keeps them, how they move between devices, and how the app and its settings reach the fleet.

Barcode capture with DataWedge intent output

On Zebra Android devices, apps usually receive scans from DataWedge, a data capture service Zebra pre-installs on every Zebra Android device. DataWedge collects data from barcode scanners, imagers, magnetic stripe readers, RFID and other inputs. It works through profiles, each of which sets how it behaves for one or more associated apps, and profiles can be set by hand, through Android intent APIs, or deployed in bulk.

DataWedge has two common ways to hand over a scan. Keystroke output types the data into the focused field. Intent output sends it to the foreground app as the payload of an Android intent, so the app’s code can save the scan and queue it for upload. The app chooses an intent action and category, and the DataWedge profile is set to the same pair, which works like a channel the app listens on. The intent carries extras such as:

  • com.symbol.datawedge.data_string, the decoded data
  • com.symbol.datawedge.label_type, the symbology, such as LABEL-TYPE-EAN128
  • com.symbol.datawedge.source, the input that produced it, which is scanner for a camera, imager or scanner

Zebra offers four delivery methods: startActivity, startService, startForegroundService and a broadcast intent. The two service methods depend on the SDK version the app is compiled for. startService does not work for SDK version 26 or above, and startForegroundService does not work for 31 or above, so a current app receives scans in an activity or a broadcast receiver. The scan reaches the app whether or not Wi-Fi is up.

Store and forward on the handheld

A handheld keeps a scan through a dead zone by writing it to local storage before it tries to send it anywhere. Android’s offline-first guidance makes the local data source the app’s canonical source of truth, usually stored on disk in a database such as Room. For data that matters, it recommends lazy writes: write locally first, then queue the change to send to the network at the earliest opportunity.

That queue is an outbox. On Android, WorkManager is the API for work that must run reliably even if the user leaves the screen, the app exits or the device restarts, and Android gives periodic syncing with a server as an example. Handhelds are docked, rebooted and passed between shifts, so pending scans have to survive all of that.

Each record needs two more things to arrive intact:

  • An operation ID. The server uses it to apply a retried upload only once.
  • A capture time set on the device. The upload can arrive hours after the scan, so the record keeps the time the work happened. GS1 EPCIS separates the two with an eventTime, when the event occurred, and a recordTime, when a repository recorded it.

Device-to-device sync and relay between handhelds

Handhelds can pass records to each other over short-range radio when neither one reaches a network. Android has built-in support for Bluetooth Low Energy, with APIs to discover devices, query services and transmit data, and its documentation names transferring small amounts of data between nearby devices as a common use. Wi-Fi Direct and Wi-Fi Aware connect Android devices over Wi-Fi with no access point.

Three patterns come up on a site:

  1. Handoff. One handheld passes a task, a pick list or a dock assignment to another, and the receiver confirms it has accepted the work.
  2. Shared state. Several handhelds count the same stock or update the same order, and their edits have to merge when the devices meet.
  3. Relay. A handheld in a dead zone passes its records to a neighbour, a vehicle terminal or a gateway closer to coverage, which carries them on. This is store and forward across devices.

The radio does not supply the rules. Discovery shows which devices are nearby, not which ones may receive a record. Android warns that data exchanged between devices paired over BLE is accessible to every app on the device, so an app carrying sensitive data needs its own app-layer security. When two handhelds change the same record apart, the app needs a merge rule or an authority, such as the warehouse management system, to decide. Android also limits what a BLE app can do in the background, which Can a BLE app run in the background on Android? covers.

Deploying apps with StageNow, MX and an EMM

Zebra fleets are staged with StageNow and configured through MX, often by way of OEMConfig and the company’s enterprise mobility management (EMM) system. An offline-capable app is an ordinary Android app, so it is installed and configured the same way as any other.

  • StageNow runs on a Windows workstation. An administrator builds a profile with wizards such as Configure a Device, Connect Network, Enroll in an MDM and Manage Applications, then publishes it as staging barcodes or an NFC tag. An operator applies it by scanning the barcode or reading the tag with the StageNow client on the device.
  • MX is Zebra’s XML-based framework for managing the capabilities and behaviour of Zebra Android devices. Devices running Android 13 still accept XML for staging, and the features added in MX 15.3 need Android 14 or later.
  • OEMConfig configures Zebra devices from an EMM. It is installed from the Google Play Store together with Zebra’s schema, and works through Android Enterprise APIs where they exist and Android managed configurations where they do not.
  • Managed configurations also let an IT admin set your own app’s options remotely. Android’s examples include whether an app may sync over cellular or only over Wi-Fi, the kind of site setting an offline-capable app needs.

OS updates and security patches reach Zebra devices through LifeGuard, generally once a month. DataWedge profiles support mass deployment, so the scanning setup an app depends on can ship with the rest of the fleet configuration.

Offline Protocol on rugged Android handhelds

Offline Protocol is device-to-device software for the layer above: handhelds sync records, send messages and hand off work directly, and relay for each other across a site, up to 8 hops over Bluetooth LE and Wi-Fi. Every message is end-to-end encrypted with MLS (RFC 9420) by default, and each device signs with its own key. Shared documents use edge sync, so edits made apart merge to the same result on every device when they meet.

The SDK supports Android 7 (API level 24) and later, through the React Native package or the Android library on Maven Central. Your app reads scans the way any Android app on a Zebra device does, for example through DataWedge intent output, and you deploy it with the StageNow, OEMConfig or EMM tools you already use.

Offline Protocol is a Zebra PartnerConnect ISV. The Zebra partner page covers scoping an evaluation on your own devices, and Logistics shows a handheld at the far fence completing a gate check through the trailers parked between it and the gate. The open-source demo apps include Stock Sync, a shared store inventory that keeps counting out of range, and YardGate, a gate check-in the officer approves on the spot.

Frequently asked questions

Can any app use the DataWedge intent APIs on Android 14?

Not by default. Starting with Android 14, Zebra secures all DataWedge intent APIs in controlled mode, so only apps an administrator has allowed can use them. Administrators can turn controlled mode off if any app needs them.

Why does a new copy of my scanning screen open on every scan?

When DataWedge delivers scans to an activity, Zebra says the activity must be declared singleTop in the app's AndroidManifest.xml. Without it, Android launches a new instance of the activity for every decode and sends the data to each one.

Can another app receive scans meant for mine?

Not if you set up component information. Intent output can name the package of each app allowed to receive scan data, and with the signature check turned on, DataWedge sends the intent only to an app whose signature matches, so a different app installed under the same package name gets nothing.

What is the difference between DataWedge keystroke output and intent output?

Keystroke output types the scanned data into the app as if someone pressed the keys, and can add TAB or ENTER to move to the next field or submit. Intent output hands the data to the app's code, and only intent output can carry raw data before any encoding.

Can Zebra devices take OS updates from a company's own server?

Yes. LifeGuard Relay Mode lets a company self-host the LifeGuard update server, and Zebra added support for it in FOTA Client 15.0.0.88 for Android 14 and later.

Which Offline Protocol package should an app on a Zebra handheld use?

The docs recommend the React Native package, @offline-protocol/mesh-sdk, for phone and handheld apps shipping now. The Android library on Maven Central, com.offlineprotocol:offline-protocol-sdk, is for building on the generated Kotlin bindings directly. Both support Android 7 (API level 24) and later.

Sources

Build it with Offline Protocol

The local handoff guide shows how to pass an operational record from one nearby device to another, keep it in a durable outbox, and track the receiving app's explicit acceptance before it reaches your backend.

Read the local handoff guide