Skip to main content
Insights / Article

The Network is Optional

By Ankit Sangwan · November 6, 2026

What four years of building apps for places where the signal comes and goes have taught me.

Picture a frontline health worker finishing a household visit at the edge of a village. She has just recorded a child’s weight, a mother’s pregnancy details and a photo of a ration card. The phone shows one bar, then none. She taps Submit.

What happens next is the whole job. If the app spins, throws an error or quietly loses the record, she stops trusting it. Once a field worker stops trusting an app, she goes back to the paper register, and the data never reaches the people who need it.

Offline-first is not a feature you bolt on. It is a decision about where the truth lives: on the phone in her hand first, and on the server eventually.

You already use offline-first apps every day

Open WhatsApp in a lift and send a message. It appears in the chat instantly, with a small clock next to it. When it reaches WhatsApp’s server the clock becomes a single tick; when it reaches your friend’s phone, two ticks. Your chats live on your phone, and photos upload on their own, so you can keep chatting while a slow image goes through.

That is by design. The app saves everything on your phone first, keeps a list of what still has to go out, and lets the network catch up in the background. Offline maps and downloaded music rest on the same idea: what you need is already on the phone. The apps that feel fastest are usually the ones that never make you wait for the network.

Field data collection needs the same thinking under harder conditions: older phones, shared devices, days without signal, and records that matter for a child’s health or a family’s entitlements.

Where the journey started

When I started working on mForm in 2022, it was already a mature app, built by Dhwani’s early mobile team, led by Sahjad with Naveen, Harish and others, and used for years across health, nutrition and education programmes. Today mForm, across its apps, backend services and dashboard, is more than 330,000 lines of code, with over 4,000 commits in the Android app alone. It had the right idea at its core: forms are saved on the phone, and syncing catches up whenever a signal appears.

Over the next four years, first on the second generation of mForm and then on the mForm SDK, the field kept teaching us the same few lessons in different ways.

Lesson one: show people their work is safe

After Submit, a spinner only says “maybe”. In the field, maybe isn’t good enough. If a worker can’t tell whether a record went through, she fills it in again, or she quietly stops using the app. So a form now counts as submitted the moment it is safely saved on the phone, the way WhatsApp shows a clock and lets the ticks follow later.

The same thinking applies to leaving. On a shared phone, logging out is exactly when unsent work can disappear. Logout now tries to send everything first, and if anything is still waiting, it says so plainly instead of letting it vanish. People trust what they can see is safe.

Lesson two: you can’t patch a phone in a village

A server can be fixed in minutes. A phone in a village may not see a network for days, so a bad update stays bad until the phone finds signal again. That shapes how you make big changes.

When mForm had to move to a new way of storing data on the phone, we didn’t switch over in one go. The old and new ran side by side, and data moved across in stages, so field workers never had to notice. Big changes since have followed the same pattern: gradual, careful, and treating the data on the phone as precious.

Lesson three: assume the phone and the network will let you down

Phones in the field are shared, full and old. A save that fails halfway is worse than one that never starts, so the app checks for space before it syncs. Networks lie, too: full bars can hide a connection that drops every few seconds. So the app retries patiently and spreads its attempts out, and a whole district coming back online doesn’t knock on the server at the same moment.

Sometimes the kindest thing is to stop trying. When people know they are out of range, they can switch on offline mode, and the app waits until they are ready.

Lesson four: make mistakes harmless

Connections will drop at the worst possible moment, so it is better to design for that than to hope it won’t happen. From our own years in the field, and from studying how other platforms handle the same problems, a few rules stuck.

Give every record its own ID on the phone, so that sending it twice still creates one record, not two. Send what the phone has changed before taking in what the server has, so fresh work is never replaced by an older copy. Let photos travel separately, so a slow upload never holds back the form it belongs to. And leave a little slack in time: ask the server for everything up to a few seconds ago, not “up to now”, so nothing saved in that split second slips through.

Lesson five: only a real phone tells the truth

In January 2026, we started the mForm SDK, an open-source toolkit that puts Frappe forms on a phone, and over the year built most of these lessons into it. Version 2.0, now in beta, saves every change on the phone first, makes retries safe, sends photos on their own, and adjusts how much it does at once to what the phone can handle. It is 43,000 lines of Dart, guarded by more than 2,300 automated tests.

Even so, the phone still had something to teach us. Many programmes need to know where a record was started, and the SDK used to collect location on a best-effort basis. Then an older Android phone showed us what “best effort” really meant. Once a user ticks “Don’t ask again” on the location prompt, the phone never shows it again, and the app went on saving every record with no location, silently, forever.

The fix was to hold a new record until the phone can actually find its location, offering the one action that solves each case: allow location, open settings, or switch location on. The back button still works, so nobody gets trapped. No test on a laptop would have caught that. A real phone did.

The phone is the most underrated computer in the room

We still talk about phones as small windows onto a server. They are far more than that. Even the shared, ageing phone in a field worker’s hand has a processor, GPS, a camera, its own database and the ability to keep working in the background. It is a field office that fits in a pocket.

Our apps rely on all of it. mForm works out whether a child’s growth is on track right there on the phone, during the visit, with no internet needed. The SDK notes the time and place when a record is started, not when it is saved twenty minutes later somewhere else. Forms, checks and lists all run on the phone, so the app is as quick in a village as it is in the office.

The server still matters: it is where the data from every phone comes together. But the work happens on the phone, and that is where design should start.

Own the problem nobody owns

None of this came from a grand design. Each lesson started as a field complaint: a form that would not sync, a logout that cost someone a day’s work, a tablet that kept crashing the same way. “The network is bad out there” is true, but it should never end the conversation. Every one of those complaints is a design brief, if someone decides to own it.

That is what I would tell anyone starting out in mobile. The hard constraint is the opportunity. No signal, a shared phone, no space left: handle them properly and you build something people in the field trust with their work.

That evening, the health worker passes the health centre and her phone finds a signal. The record from the edge of the village goes through on its own. She never has to think about it.

Trust is the feature. Everything else is sync.

Thanks to Sahjad Ansari, Naveen Gupta, Harish Uginval, Shrey jain Omprakash Kandhi Bhushan Barbuddhe and everyone who has shipped mForm and the SDK over the years.

The mForm SDK is open source under the MIT licence: github.com/dhwani-ris/frappe-mobile-sdk.

#OfflineFirst #MobileEngineering #Flutter #Frappe #OpenSource #DataForGood #DhwaniRIS

← All insights

We use cookies (Google Analytics) to understand how visitors use our site. No advertising or tracking cookies are used.