Native OData Offline Task Flow

Develop an offline native OData application.

Setting Up a Native OData Offline Application

This task flow does not include all configurable options, but guides the developer and server administrator through the commonly performed tasks required to configure an offline application.

  1. Determine the data requirements of your offline application:
    1. Identify the data to be made available offline - identify the portions of your application that are to operate offline, and the OData entity collections to be referenced.
    2. Compile the list of entity collections into an initial defining request.
    3. Reduce the overall data transmitted to the client - your application often requires only a small subset of the data available in each entity collection. Review each referenced entity collection. Determine if it is possible to reduce the amount of data by using OData $select, $filter, or other queries. If so, add those OData URI primitives to the collection referenced in the defining request.
    4. Identify sharable data collections - for security or performance reasons, an OData Web service may intrinsically filter the results that are visible to the user who is logged in. In other cases, the result set may be exactly the same for all users of the application. Such collections can be marked as shared on SAP Mobile Platform Server or mobile service for development and operations, which optimizes back-end requests. Review your entity collections and identify any collections that meet this "shared" definition, and mark them as such in the defining request.
  2. Create the offline application configuration initialization (.ini) file for the offline application, which has two main sections:
    1. Endpoint – identifies and determines how OData producer endpoints from which the offline app retrieves and stores offline data should be processed by SAP Mobile Platform Server or mobile service for development and operations: how the offline database is prepopulated before it is downloaded to the client, indexing, and so on. See Application Configuration File
    2. Defining requests – defines various characteristics of how the retrieved data for a given endpoint is managed by SAP Mobile Platform Server or mobile service for development and operations: whether or not the data is shared, refresh interval, delta tracking, and so on. See Defining Requests
  3. Configure SAP Mobile Platform Server or mobile service for development and operations for offline applications:
    1. Create the application on the server. See:
    2. Configure the endpoints. See:
    3. Configure offline specific settings. See:
    4. Import offline application settings from the application configuration file. See:

Working With an Offline Store

You can find additional details for performing these tasks on the SAP Community Network (SCN) Mobile Application Development Platform for Developers - Native AppsInformation published on SAP site (including blog posts and How-To guides), and the Offline OData API documentation for your platform Native OData API Reference:
  1. (Optional and requires SAP Mobile Platform SDK version 3.0 SP11 at minimum) Test the offline store. See ILOData
  2. Call GlobalInit – performs static initialization of global memory data structures. This method must be called exactly once at the start of the application, before anything else from the Offline OData library is called.
  3. Create and open an offline store. An application can create and manage multiple store objects if required.
  4. Populate the offline store by performing an initial sync (which is built into the open operation). The application must have network connectivity. During initialization, the client communicates with SAP Mobile Platform Server or mobile service for development and operations, which collects data from an OData endpoint based on the defining request, creates a database that stores the data, and pushes that database down to the offline store on the device.
  5. Using the same OData APIs that manipulate an online store, perform any necessary operations (create, read, update, and so on) on the data in the offline store.
  6. Send pending modification requests to the server/back-end (flush operation). The application must have network connectivity. The server (SAP Mobile Platform Server or mobile service for development and operations) and the back-end determine how conflict and error resolution are handled. See Designing an Offline Application to Handle Conflicts and Errors for more information.
  7. Refresh the offline store. The application must have network connectivity. See Offline OData Refreshes and Updates for more information.
  8. Call GlobalFini – removes data from and delete the offline store and release resources after the last use of the Offline OData library.