Custom software

Designing offline-first mobile apps for field teams

Decide which field tasks must work offline, how edits and photos sync, how conflicts and sign-in are handled, and what to test on real phones.

Decide what workers need when the connection drops

An office Wi-Fi test tells you little about a basement equipment room, a warehouse, or a delivery route with gaps in coverage. A phone can also reach its mobile data allowance. Write down what a worker needs to finish under those conditions before you choose the technology.

Android's offline-first guidance starts with the critical tasks that stay available without a network. An inspector may need to open a saved assignment, record findings, take photos, and collect a signature. The office can wait for the result to sync if the worker can finish safely and the data is saved.

List each field task. Mark it as usable offline, able to wait for a connection, or dependent on a live answer. Completing a safety checklist can work offline. Confirming that a customer has paid requires up-to-date information. Ask each vendor to price the offline work and show what the worker sees when a task needs a connection.

Read and write field records locally

For editable offline records, display the current on-device copy. Save the change and an entry in the outgoing queue, often called an outbox, in one local transaction. A crash between separate writes could leave a change with no queue entry. When a connection is available, the sync process sends queued changes and applies updates from the server to the local database. The screens read from that database so they stay consistent as the connection changes.

How an offline edit reaches the server

  1. Write locallySave the inspection result to the on-device database.
  2. Add to the outboxIn the same transaction, queue the change with its unique ID, time, and starting record version.
  3. Wait for a connectionKeep the committed queue across app restarts, phone reboots, and flat batteries.
  4. Send and confirmThe server recognizes repeats, applies the change once, and returns the outcome and record version.
  5. Apply server updates locallyWrite new assignments and office edits back to the on-device database.
The worker can continue using the saved data while the app waits for confirmation from the server.

The change ID and record version serve different purposes. A connection may drop after the server accepts an edit but before the phone gets the answer. Reuse the change ID when retrying. Record the accepted ID and its outcome on the server with the change, so repeat delivery can return the same outcome. The starting record version tells the server whether another change intervened. The website and ERP integration guide explains this duplicate protection in the context of orders.

Choose the write strategy by record

Android's guidance describes three patterns. A field app can use all three, depending on the task.

StrategyHow it worksExample
Online-onlyMake the change on the server and show a failure if it cannot be confirmedTake a card payment or reserve the last spare part
QueuedQueue a deferrable event and send it laterUsage analytics or diagnostic events
Local firstSave the change immediately on the device and queue it for the serverChecklists, readings, photos, signatures, and eligible task updates

For local-first changes, include conflict handling in the requirements and estimate. For a task that needs a live answer, tell the worker before they fill out the form. A short message such as “Connect to check stock” explains why an action is unavailable.

Give each important field a conflict rule

A supervisor may reassign a job while the technician marks it complete offline. Two inspectors may update the same meter reading. Decide what the server will do and show the outcome to the workers who need it.

Last write wins stores the latest change according to the ordering you choose. Device clocks can disagree. Server receipt time avoids relying on a device clock, but an older offline edit can arrive last. A field-level merge can keep a supervisor's change to the assignee and a technician's change to a separate field, if the rules allow those edits together. For dependent fields, enforce the business rule on the server. For example, the server can reject reassignment after a job is complete, or require a supervisor to approve a replacement reading.

Choosing a conflict rule for an offline record

What should happen when changes compete?

  • A low-risk field where arrival order is acceptableUse last write wins by server receipt time. A delayed edit can arrive last.
  • Separate fields with compatible editsMerge the fields where the business rules allow it.
  • Money, stock, safety, or legal status is affectedApply a business rule on the server and retain the losing change for authorized review.
  • No rule can decide safelyPreserve both versions and assign the decision to a named person.
Set each rule in the requirements. Test the conflict from both devices.

When the audit policy requires it, retain the losing change with the editor, time, device, and rule applied. Restrict access to the conflict record.

Keep photos and signatures in a separate upload queue

Estimate file sizes, free storage, and transfer time separately from structured records. A checklist entry may take a few hundred bytes. Inspection photos may take tens of megabytes on a phone with little free storage and a weak connection.

Save files to app-managed storage and link them to the record by ID. Upload them separately. If the workflow permits it, let the server accept the record while marking its files as pending. When evidence is required, keep the job incomplete until the files are confirmed. Agree on image size and quality, decide which originals are needed, and show the worker what to do if the phone lacks space. Preserve unsent files through restarts.

Apple's background transfer guidance covers HTTP and HTTPS and requires a file-backed upload for transfers that continue after the app exits. It recommends handing multiple tasks to one background URL session to avoid delays from repeatedly waking the app to start another transfer. Queueing 40 photos together lets the system schedule them without an app relaunch for each photo. The session configuration reference explains that a user force-quitting the app cancels its background transfers. Keep enough local state to resume when the user opens it again.

Agree how long offline access can last

A worker with no signal cannot complete a new server sign-in. Allow offline access only for an already authorized user, within an agreed time limit. Choose the limit based on the data on the device and what would happen if the device were lost.

Encrypt the local records and files. Use Apple Keychain access rules for credentials or keys on iOS. On Android, use the Keystore to hold cryptographic keys, including a key used to encrypt a stored token or local data. Keystore can restrict key use to users who recently authenticated with the device. A PIN or biometric can unlock authorized local access where policy allows it. Check which data and keys are available when the device is locked or after a restart, especially if you plan to sync in the background.

Revocation cannot reach a device that never reconnects. Enforce offline expiry locally and recheck authorization on reconnect before accepting further access or writes. Follow the approved policy for clearing data and recovering authorized work that has not synced. On a shared device, isolate each worker's local records or clear them at sign-out when their queue is empty. Handle unsent work before removing its only copy.

Design for delayed background work

Android can defer network access and scheduled work in Doze and App Standby. When the device is unplugged, at rest, and the screen is off, Doze defers normal work to maintenance windows. Those windows become less frequent. App Standby can restrict apps that are rarely used. WorkManager can retain scheduled work through restarts and apply constraints and retry delays. It does not promise a fixed sync time. Test without requiring a battery optimization exemption.

On iOS, the system chooses when to run a background refresh. Apple's background strategy guidance describes up to 30 seconds for app refresh or handling a delivered background notification. It also describes rate limits for frequent background notifications, including when sending more than three an hour. Delivery and timing are not guaranteed. Use a background URL session for suitable transfers and keep a separate foreground sync path.

Try to sync when allowed in the background and when the worker opens the app or returns to it. If no connection is available, keep the queue and make its state visible. A status such as “3 changes waiting to send. Last confirmed sync at 10:42” tells the worker what is still pending.

Test on the phones workers actually carry

Build the test list from the device models and operating system versions in use. Include the oldest supported phone and the one with the least available storage. Simulators help during development. Real phones reveal restrictions and failures that depend on battery settings, storage, and weak coverage.

Offline checks before a release

  • A full shift offlineComplete a day's jobs in flight mode. Reconnect and check that each change and photo is accounted for once.
  • Connection lost during syncTurn off data mid-transfer and verify that retries neither lose nor duplicate changes or files.
  • Conflicting editEdit the same job on two offline devices and verify the agreed rule and required audit entry.
  • Doze and standbyOn an Android test device, use adb shell dumpsys deviceidle force-idle. Exit the test state and check whether sync resumes.
  • App closed and phone restartedForce-close with queued items. Reboot, reopen, and verify that the queue survives and transfers can resume.
  • Low storage and batteryTest capture and sync with little space and battery saver enabled. Verify that the app reports failed captures and retains unsent work.
  • Revoked userDisable the test account, reconnect, and verify that access stops and local data is handled under the approved policy.
Write the expected result for each test. Android's Doze guidance includes commands for entering and leaving the test state.

Run representative tests where workers use their devices. Half a day in a basement or warehouse can reveal problems such as labels that do not scan under the available light or a signature area that cannot be used with gloves.

Roll out by crew and test the vendor's plan

Managed company devices can give IT control over updates and app settings. Android's managed configuration guidance gives mobile data versus Wi-Fi for syncing as an example of an administrator-controlled setting. If the app implements that option, IT can change it without a new app release. Confirm which settings the actual devices and management software support.

Start with one crew for two weeks. Check its sync queue and conflict log daily, reconcile the office records with work done on site, and fix issues before expanding. Keep the existing paper or spreadsheet process available through that verification.

  1. Which tasks work offline, which can wait, and which need a live answer?
  2. What is the conflict rule for each significant field, and what happens to the losing edit?
  3. How does the server recognize a duplicate request after the connection drops?
  4. How does the app queue, resize, and retry photos? What happens when storage is full?
  5. How long can offline access last? When do revocation and the data handling policy take effect?
  6. Which phone models, operating system versions, and field conditions are in the test plan?

Compare Flutter, React Native, and native development after defining the offline work. Review the App Store and Google Play requirements if you plan to distribute through those stores. Our iOS and Android development service covers field workflows and sync. Tell us about your field team.

Questions buyers ask

Which tasks should a field app support offline?

Support the tasks workers need on site, such as opening a saved assignment, completing a checklist, taking photos, and recording a signature. A payment confirmation or a reservation of shared stock needs a live answer. Tell the worker before a task starts if it needs a connection.

When is last write wins an acceptable conflict rule?

Use it for low-risk values where the agreed meaning of latest is acceptable, such as a preferred visit time. Arrival order and edit time can differ. For amounts, stock, safety records, or job status, use an explicit business rule or require review. Keep the losing change where the audit policy requires it.

How many devices should we test?

Start with the devices workers carry, including the oldest supported or lowest-specification phone in service. If you support both platforms, include a current iPhone and Android phone. Cover the real operating system versions, storage conditions, and battery settings. The necessary device count follows from that list.

Can we build an offline-first app with a cross-platform framework?

Yes. Flutter and React Native can use an on-device database and a durable sync queue. The platform still controls background execution and file transfers. Test on Android and iOS separately for the versions your team supports.

Sources

  1. Android Developers, build an offline-first app
  2. Android Developers, Doze and App Standby
  3. Android Developers, persistent work scheduling
  4. Apple Developer, choosing background strategies
  5. Apple Developer, background file transfers
  6. Apple Developer, background URL session configuration
  7. Android Developers, Android Keystore system
  8. Apple Developer, Keychain item access rules
  9. Android Developers, managed app configurations

Your next chapter

Let’s build
something useful.

A product to launch. A system to improve.
An idea worth exploring. Start with a conversation.