Offline field app Design your app for the place with no signal

A driver stands at a farm gate in a wadi and taps "delivered". The confirmation sits on the phone. Working offline is a decision made before the first screen, and it costs far more to add after the first complaint.

Published Naqrah Tech, Muscat7 min read

A glass phone on a metal warehouse shelf with a brass circle beside it standing for a connection

In short

Offline work is a design decision made on day one, and adding it later costs more. The signal icon describes the phone, while your app needs to know whether the data reached the server. So decide first what lives on the phone, then build a sync queue, then test the app in airplane mode in the place where the employee will actually work.

  • Decide on day one what stays on the phone and what still needs a connection.
  • Sync needs a queue, IDs generated on the device, and a clear rule for which edit wins a conflict.
  • Test the app in a basement or on site before you test it at the office desk.

The signal icon describes the phone only

A phone can show two full bars while the order is still unsent. A typical case: a driver stands at a farm gate in a wadi on a road out of Muscat and taps "delivered". The app says the order was sent, but the confirmation never reached the server. An hour later the accountant calls to ask for the delivery receipt, and everyone searches for it without knowing where it stopped.

The documentation for the connectivity_plus package in Flutter is clear about this. It says that a connection type being available leaves internet access unconfirmed, and it warns that a phone can report a Wi-Fi connection with no working internet behind it. The documentation advises against deciding whether a network request is reliable from the current connectivity status alone.

The fix is to learn whether a send succeeded from the server's reply alone, and to treat the phone's icon as weak evidence. The record stays local until the server confirms it, and the app retries in the background. That changes the whole interface. The button becomes a status the employee can see, and that status ends only with a confirmation from the server.

Decide on day one what stays on the phone

Every offline problem starts with a small table. List each action an employee performs in the field, and decide whether it works without a network:

What works without a network in a field delivery app
ActionWorks offline?Reason
View today's route listYes, from a local copyThe driver needs the list before leaving the depot
Confirm delivery and add a commentYes, with a local timestampThe confirmation is saved first and then sent
Take a photo of the receiptYes, uploaded from the queueThe photo is heavier, so it uploads when a suitable connection appears
Change the shared stock balanceNeeds a connectionThe figure is shared across teams and has to stay one number
Collect a card paymentNeeds a connectionThe payment is verified live with the payment provider

The table settles the question before the first screen. Whatever the team and the developer agree on here is what gets priced and built. Any row that moves from "yes" to "needs a connection" needs a stated decision before pricing, so that its effect on the schedule is known early.

The sync queue

Every change is written locally first, with an ID generated on the phone, a timestamp and a clear status: waiting to send, sent, or failed with a stated reason. The queue is the list that tells you what is still missing. Without it you know something is missing, but not where.

The ID generated on the phone prevents duplicates. If the connection drops after the request reaches the server and before the reply comes back, the phone sends the same ID again, and the server recognizes the same request. That is what makes retries safe: the server stores each ID once.

On Android, the WorkManager library runs deferred work under constraints you set in the request. The Android documentation says that when the work runs depends on the constraints in the request and on system optimizations, and that WorkManager is designed to behave well under those restrictions. So sync gets scheduled. Its timing can be planned, but no exact moment can be promised. Build the queue on that basis.

When two people edit the same record

The driver confirms a delivery inside a tunnel on the road, while the supervisor back at the office moves the same order to another day. Both phones hold a valid copy of the order. When the connection returns, which version wins? There are four practical options:

  • Last edit wins. The simplest choice, and it quietly drops the first person's edit.
  • Field-level merge. The driver's status is kept and the supervisor's date is kept, because each changed a different field.
  • Status rules. A status moves forward only, so "delivered" is accepted whatever order the messages arrive in.
  • A manual resolution screen. It shows both versions to the person who decides, for the cases the code leaves open.

The safest choice is usually a mix of the last three. The rules live in the database, so the server has the final word, and the phone only proposes. Teams that run field crews on iOS and Android apps need this decision in the first week.

What the employee sees in the basement

The most confusing state is the silent screen: a spinner that never stops, or a button that seems to have done nothing. The employee in the basement has no way of knowing whether the tap reached the server. A good screen says something specific in each state. Three examples of the wording:

  • "Saved on this phone, waiting to send" for an order still on its way to the server.
  • "Sent" appears only after the server replies.
  • "Sending failed, because of this" with a retry button and a reason written in plain language.

Have a translator write these states in Arabic, and test them with an actual employee. Wording the developer understands can still be unclear to the driver.

Test in airplane mode

A test on office Wi-Fi shows the screens work. It leaves the most important question open. These developer tools help:

  • On an iPhone, Xcode can place a device tethered to your Mac under network conditions from the Devices and Simulators window. The conditions apply to the whole system, so the app sees the network exactly as configured. Apple presented this capability in its WWDC 2019 session.
  • On the Android emulator, the -netspeed and -netdelay options set speed and delay. The documentation says the setting applies to Ethernet and cellular.

Shaping speed is different from a full loss of signal, which requires airplane mode on a real device. That is the test that exercises the queue. Run this sequence:

  1. On the phone, add three records: a delivery confirmation, a receipt photo and a comment. Then switch on airplane mode.
  2. Close the app fully from memory, then open it again. The three records should still be there, unchanged.
  3. Reconnect and watch the queue until every item clears with a confirmation from the server. Then check the status on the server itself.
  4. Repeat the scenario with two phones on the same record: one changes the status, the other changes the date, and both return to the connection.

Name three things a driver must finish with no signal. Then ask the developer to show those three in a basement. If the app completes them alone, that part is done. If it stumbles on any of them, fix those three before the rest of the screens.

Sources

  1. pub.dev: connectivity_plus package documentation
  2. Android Developers: WorkManager getting started
  3. Android Developers: Android Emulator command-line options
  4. Apple Developer: WWDC19, Designing for Adverse Network and Temperature Conditions

This post is general planning information as of its publication date. Your project's decision needs tests on your own devices and in your own places of work.

Tell us where your team works

We tell you which actions work in the basement with no signal and which need a connection, then test the idea in that place before the rest is built.

Or call us on +968 7119 0707, Muscat, Sultanate of Oman