SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Introduction to Offline OData

Offline OData consists of many pieces at the back-end and the front-end that eventually make offline OData work, without being in the way of the developer. This tutorial will explain how all components work together to achieve this.

Overview

Daniel Gombar D Daniel Gombar January 9, 2023
Created on January 9, 2023
Contributors

More from Daniel Gombar

See all 2 tutorials by Daniel Gombar →

Prerequisites

Steps

Details

You will learn

How the SAP BTP SDK for iOS creates an offline store on the mobile device, how it keeps data in sync, and how data entered locally is flushed back to the originating OData service


You may have noticed that if you launch modern apps such as Facebook, LinkedIn and your E-mail application, they will also work when you are offline. Instead of an empty screen, they show you cached data of the last time they were connected. Needless to say, making an app work in even offline scenario’s increases overall user-experience and may have business benefits.

Not having any data connection in even the wealthiest and most developed cities of the world could lead to the conclusion that the mobile connectivity/bandwidth issue isn’t just going to solve itself on a global level anywhere in the near future. Capacity problems at crowded areas or events, varying coverage and zones with zero reception, unreliable connections (both WiFi and telco) and problems incurred through traveling will likely persist.

This is the reason why many apps are sensitive to the device’s connection state and have offline fallback mechanisms built-in. When in offline mode, some aspects of an app will necessarily stop working, but many others don’t.

Why offline: Business doesn’t always happen where networks exist.

Step 1 SAP BTP SDK for iOS - Offline OData service
—

The Offline OData feature of the SAP BTP SDK for iOS allows you to develop Always-available application that can respond quickly to changes in the connection state. Instead of calling OData services directly, the OData service call will be redirected to the Offline OData feature, which will mimic a response using the latest synchronized data.

Features:

  • Synchronize OData services and run them locally on a device
  • UltraLite as client database, which is optionally encrypted
  • Optimized for OData services supporting delta queries to synchronize only new and changed items
  • Middle-tier delta enablement on SAP BTP for services that don’t support delta queries
  • Middle-tier caching of generic OData collections that are not user dependent, so that e.g. not every user needs to read the same master data from the source OData service
  • Offline OData services work in both read and write mode, allowing users to enter data on their device. OData updates are played back to the originating OData service when the user comes back online.
  • Data synchronization between the app and the SAP BTP will leverage the MobiLink protocol which is designed for synchronizing remote databases.

Please find a schematic representation of the synchronization flow below:

Delete existing registration
Delete existing registration

Step 2 Creation of a database
+
Step 3 Refreshing the database
+
Step 4 Data Flush sequence
+
Step 5 Error and events
+
Step 6 Configuration of the SAP BTP
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. SAP BTP SDK for iOS - Offline OData service 2. Creation of a database 3. Refreshing the database 4. Data Flush sequence 5. Error and events 6. Configuration of the SAP BTP