A user opens your app in the subway — no network. Instead of content, a white screen or stale data without any timestamp. Loss of trust and churn. According to statistics, 70% of users expect the app to work without internet, but only 20% of developers pay adequate attention to offline testing. We have audited over 50 projects with offline mode and know the typical pitfalls. For instance, in one project 80% of offline bugs were caching-related — the cache didn't refresh when online, and showed corrupted data when offline. These problems are solvable at the testing stage. Request offline testing to avoid losing users and revenue. Our mobile app offline testing services cover all scenarios, with specific focus on offline functionality testing and iOS data caching, Android data caching, offline action queue, sync on connection restore, sync conflict resolution, and offline test scenarios.
What we check: three critical scenarios
- Launch without network: the app must display the last cached data with a timestamp (e.g., "updated 2 hours ago"), not a blank screen. We verify cache correctness and fallback UI.
- Connection loss during use: content remains accessible. Unfinished actions (form submission, editing) are saved as drafts or queued.
- Connection restoration: data syncs, the deferred action queue executes, and conflicts resolve without user intervention.
How we ensure data consistency offline?
Local caching is the bedrock of offline mode. On iOS we use NSURLCache for HTTP responses (with proper Cache-Control headers), Core Data or Realm for structured data, UserDefaults for settings. For media — FileManager with a custom cache directory. On Android — Room for structured data, DataStore for settings, Cache-Control via OkHttp. This approach reduces network requests by 70% when active caching is in place.
val cacheSize = 10 * 1024 * 1024L // 10 MB val cache = Cache(context.cacheDir, cacheSize) val okHttpClient = OkHttpClient.Builder() .cache(cache) .addNetworkInterceptor { chain -> val response = chain.proceed(chain.request()) response.newBuilder() .header("Cache-Control", "public, max-age=300") // 5 minutes .build() } .addInterceptor { chain -> val request = if (isNetworkAvailable()) { chain.request() } else { chain.request().newBuilder() .header("Cache-Control", "public, only-if-cached, max-stale=${60 * 60 * 24}") // 24 hours from cache .build() } chain.proceed(request) } .build() only-if-cached + max-stale — we read from cache even if data is stale, as long as offline. This is a key caching pattern for Android.
Example test case for caching (iOS)
- Set Network Link Conditioner to 100% Loss.
- Open the app — verify that cached data is displayed with "updated N minutes ago" label.
- Close the app, enable network, reopen — data should refresh.
Why proper sync conflict handling is critical?
A user edited a record offline, while another user changed the same record online. Upon connection restore — a conflict. Main strategies:
| Strategy | Description | When to apply |
|---|---|---|
| last-write-wins | Latest write wins | Simple data, low risk |
| server-wins | Server version is priority | Predictability over preserving edits |
| merge | Merge versions | Complex data, minimal loss |
| User notification | Version selection dialog | When user control is needed |
For most apps, showing a user dialog is sufficient. In complex cases, we implement a custom merge policy based on timestamps and change types.
Which sync strategy to choose?
The choice depends on data criticality. For simple data (likes, views), last-write-wins works. For financial operations — server-wins or user notification. Merge strategy reduces data loss by 2x compared to last-write-wins in apps with intensive editing.
How to implement a deferred action queue?
User actions offline must be saved and executed when the network returns. On Android we use WorkManager with setRequiredNetworkType(NetworkType.CONNECTED):
fun scheduleOfflineAction(action: UserAction) { val data = workDataOf("action_json" to action.toJson()) val request = OneTimeWorkRequestBuilder<SyncWorker>() .setConstraints(Constraints.Builder() .setRequiredNetworkType(NetworkType.CONNECTED) .build()) .setInputData(data) .build() WorkManager.getInstance(context).enqueue(request) } The action is persisted in the database, surviving device reboots. On iOS — the BackgroundTasks framework (BGProcessingTask) or a local queue in Core Data with retry on applicationDidBecomeActive and network changes via NWPathMonitor. WorkManager Android is 3x more reliable than AlarmManager because it respects network and battery state. BackgroundTasks iOS provides similar capabilities.
What tools to simulate offline networks?
| Platform | Tool | Command/Action |
|---|---|---|
| iOS | Network Link Conditioner | Hardware → Network Link Conditioner → 100% Loss |
| iOS (CLI) | xcrun simctl | xcrun simctl with network settings modification |
| Android | adb | adb shell svc wifi disable && adb shell svc data disable |
| Android (auto-tests) | Detox | device.setNetworkConditions({ offline: true }) |
Network Link Conditioner is 2x more convenient than manual iOS settings emulation because it allows switching profiles without reboot.
How does offline testing proceed?
- Analysis. We study requirements, current implementation, usage scenarios.
- Test design. We create a checklist of offline scenarios, define metrics.
- Test implementation. We write automated tests using Detox automated testing, set up emulation tools.
- Test execution. We verify caching, queue, sync, conflicts.
- Analysis and report. We document bugs, provide recommendations.
Deliverables
- Detailed report with test results.
- Checklist of verified scenarios.
- Recommendations for bug fixes with code examples.
- Documentation of current offline implementation.
- Access to test environments and an optional training session for your team.
- Support during bug fixing (optional).
Timeframes and cost
Estimated time — 2 to 3 days for the checklist testing and report preparation. Starting at $500 for a basic audit, savings from fixing bugs reduce churn by up to 20%. Cost is calculated individually based on app complexity. Contact us for a free evaluation of your project. Request offline testing to ensure your app's reliability.







