Show TOC

Developing a Hybrid SDK (Kapsel) Application With OData OfflineLocate this document in the navigation structure

Develop an offline Hybrid OData application.

Setting Up a Hybrid 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.

Note A supported version of an OData (for example V2) Web service must be available and accessible by SAP Mobile Platform Server or SAP HANA Cloud Platform mobile services . For example Netweaver Gateway, Integration Gateway, or a third-party service such as Apache OlingoInformation published on non-SAP site.
  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 SAP HANA Cloud Platform mobile services, 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 SAP HANA Cloud Platform mobile services: 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 SAP HANA Cloud Platform mobile services: whether or not the data is shared, refresh interval, delta tracking, and so on. See Defining Requests
    Remember Use an application configuration file only if you require non-default behavior.
  3. Add the Offline OData Plugin to your Hybrid App. See Offline OData Plugin
  4. Configure SAP Mobile Platform Server or SAP HANA Cloud Platform mobile services 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 - Hybrid AppsInformation published on SAP site (including blog posts and How-To guides), and the OData API documentation that is bundled with the SAP Mobile Platform SDK:
  1. Create and open an offline store. An application can create and manage multiple store objects if required.
  2. 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 SAP HANA Cloud Platform mobile services, 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.
  3. 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.
  4. Send pending modification requests to the server/back-end (flush operation). The application must have network connectivity. The server (SAP Mobile Platform Server or SAP HANA Cloud Platform mobile services) 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.
  5. Refresh the offline store. The application must have network connectivity. See Offline OData Refreshes and Updates for more information.
  6. Remove data from and delete the offline store.