Offline mode in an existing mobile app — how to add it without rewriting the whole app

Offline isn't one feature but four levels with different costs: from clear handling of a lost connection, through offline reading and queued writing, to full synchronisation. How to add them to a live app, what to change on the backend, and what it costs.

Zespół Mobilesoft· Engineering team· 19 listopada 2026· 8 min czytania

"The app doesn't work in the warehouse", "everything disappears in the lift", "the order was sent twice". Reports like these usually mean the app assumes a constant internet connection — and its users don't have one. The company then asks about offline mode and often hears that the app has to be rewritten from scratch.

Sometimes that's true, but usually it isn't. Offline isn't a single feature; it's several levels with very different costs. In this article we describe how to add offline support to an app that's already live, step by step — starting with changes that improve the user experience in a few days and ending with full synchronisation.

Four levels of offline mode

Level What the user sees without a connection Complexity 1. Graceful handling of no connection A clear message instead of a blank screen or an error, automatic retry when the connection returns Low 2. Offline reading The most recently downloaded data: job list, product catalogue, history Medium 3. Offline writing with a queue Can create and edit data that's sent once the connection is back High 4. Full synchronisation Data changed simultaneously on several devices and in the back office, with conflict resolution Very high

Most apps need levels 1 and 2, and some need level 3 for one or two key processes. Level 4 is justified in field apps, such as apps for transport and logistics, where working without coverage is the norm.

Before you decide, check the data for where and how often users lose connection. Network errors in crash reports, failed requests in backend logs, and customer reports are usually enough to identify the two or three screens worth starting with.

Level 1: an app that doesn't panic without a connection

This is the cheapest step and often gives the biggest improvement in ratings. In older apps we take over, a lost connection usually ends in one of three ways: an endless spinner, an empty list with no explanation, or a crash.

What this level covers:

  • detecting connection state and showing "No connection" instead of a generic error,
  • sensible request timeouts — a weak connection is worse than none, because the request hangs forever,
  • automatic retry when the connection returns, with a delay that increases on each attempt,
  • preventing double submission of a form when the user taps the button several times.

This level doesn't require architectural changes. It's usually a few days of work, and it also improves the app's perceived speed — we cover what else affects it in the article on why an app is slow.

Level 2: offline reading

This is where local storage comes in. The app saves downloaded data in an on-device database, shows it from there first, and refreshes it from the server in the background.

Platform Typical solutions Android Room (SQLite) iOS SwiftData, Core Data, SQLite Flutter drift, sqflite React Native SQLite (e.g. op-sqlite), WatermelonDB Firebase Firestore has built-in offline persistence on Android and iOS

The most important decisions at this level aren't technical but product decisions:

  • Which data to keep locally — not the whole 50,000-product catalogue, just what the user needs in the field.
  • How long data stays valid — a price from a week ago can mislead a customer. Show when the data was last updated.
  • What to do with sensitive data — personal and medical data in a local database should be encrypted and deleted on logout. More on this in the article on mobile app security.

In an existing app, the key factor is how data access is organised. If screens call the API directly, you first need to introduce an intermediate layer (a repository) that decides whether data comes from the server or the local database. That's refactoring, but it can be done screen by screen without rewriting everything — just like the other changes described in the article on extending an existing app.

Level 3: offline writing and an operation queue

The user fills in a form, takes a photo, confirms a job — without a connection. The app saves the operation in a local queue and sends it when the connection returns. It sounds simple, but this is where most of the hard bugs appear.

What to watch out for:

  • Idempotency. If a request reached the server but the response got lost, the app will send it again. Without a unique operation key that the backend recognises as a duplicate, you'll get two orders. This is the most common cause of "it was sent twice" reports.
  • Order. An edit to an order can't arrive before the order is created. The queue has to preserve the order of dependent operations.
  • Event time. Record when the action happened on the device, not when it was sent — otherwise a customer signature from 9:00 lands in the system as signed at 15:00.
  • Server-side rejections. What if an operation saved offline is rejected because the price changed or the job was cancelled in the meantime? The user has to find out and know what to do.
  • Background sending. On Android, WorkManager handles this. On iOS the system decides when and whether to run a background task (BGTaskScheduler), so you can't assume data will be sent before the user opens the app again.
  • Large files. Send photos and documents separately, with resumable uploads, not in one request with the rest of the data.

Level 4: synchronisation and conflicts

When the same data can be changed in several places at once — by two workers offline, or by a worker and the office — you need a conflict resolution strategy:

Strategy How it works When it's enough Server wins The device change is rejected if the record changed in the meantime Data managed mainly from the office Last write wins The change with the latest timestamp applies Simple data, rare conflicts Field-level merge Changes to different fields of the same record are combined Forms edited by several people User decides The app shows both versions Data where a mistake is costly

At this level it's worth considering ready-made sync engines instead of writing your own. But look at the vendor's stability: MongoDB discontinued Atlas Device Sync (sync for the Realm database) — the service was shut down on 30 September 2025, and apps built on it had to migrate urgently. We describe how vendor decisions like this affect apps in the article on deprecated SDKs and APIs.

What has to change on the backend

Offline isn't just app-side work. From level 2 upwards, the backend usually needs changes:

  • fetching changes since a given point instead of the full list on every refresh,
  • version markers or modification dates on records to detect conflicts,
  • soft deletes — the app needs to learn that a record was deleted, so it can't just vanish from the database,
  • support for idempotency keys for queued operations.

These changes have to be introduced without breaking older app versions that don't use them — we described the rules in the article on API changes and old app versions.

How to test offline mode

Testing in an office with good Wi-Fi won't uncover offline problems. You need:

  • scenarios where the connection drops during an operation, not just before it,
  • weak network simulation — Network Link Conditioner on iOS, bandwidth throttling in the Android emulator,
  • sync tests — two devices changing the same record offline,
  • a real-world test — a warehouse, a basement, a route outside the city, if that's where your users work.

How much does it cost

Level Indicative effort At PLN 180 net/h 1. Graceful handling of no connection 16–40 h approx. PLN 2.9k–7.2k 2. Offline reading for key screens 40–120 h approx. PLN 7.2k–21.6k 3. Offline writing for 1–2 processes 80–200 h approx. PLN 14.4k–36k 4. Full synchronisation with conflicts from 200 h from approx. PLN 36k

The amounts cover work on both the app and the backend, and go up if the app's architecture first needs its data layer refactored. The rate and scope are indicative — the real cost depends on the number of screens and the state of the code.

Summary

You don't have to introduce offline mode all at once. Start with level 1 — clear handling of a lost connection, which costs a few days and removes most of the frustration. Then add offline reading for the screens users need in the field, and queued writing only where working without a connection is an everyday reality. Keep full synchronisation for situations where it's genuinely needed.

We add offline mode to existing apps as part of mobile app maintenance, and handle the server-side changes as part of our backend and API service. If you want to know what state your app is in and where to start, request a free app analysis or get in touch.