Skip to content

Defining Offline Settings for Applications

Define offline settings for the selected application. Offline support enables client applications to access back-end data without a connection. When offline, applications access data from an offline store on the client. SAP Mobile Services moves data between the back end and the client offline store.

The destination settings determine how SAP Mobile Services creates the initial offline store on the client, and how it processes requests for updates from the back end. Define offline back-end connection settings for an application by importing a configuration (.ini) file that has been prepared by a developer. To adjust any settings, you can use the built-in editor to change the properties accordingly at runtime. Be sure to confer with the application developer before making any changes, since changes can impact the mobile application significantly.

See these sections in the Native OData App Development and SAP Business Technology Platform SDK documentation:

To define settings:

  1. In SAP mobile service cockpit, select Mobile Applications > Native/Hybrid.

  2. Select an application, then select Mobile Offline Access under Assigned Features.

  3. Select Configuration to see a list of configured destinations.

  4. To import an offline configuration, select the upload icon, browse and select a configuration file.

    Note

    Only .ini files can be imported. When you import settings, the state of the offline configuration changes to Configured.

    For information about Application Configuration files, see:

  5. Select the Offline Policies tab to set incoming request throttling threshold and offline store upload policies for the application.

    1. Under Throttling Policy, select Enable Throttling to set throttling policy. Once the policy is enabled, you can control the activity level for the application. Set thresholds for throttling activity once thresholds are reached.

      For Incoming Request Throttling Threshold, configure the request throttling threshold, from 1 to 200 requests. The default value is 200 requests per second. When the offline service reaches the threshold value, no additional requests are handled.

    2. Under Offline Store Upload Policy, select Enable Offline Store Upload to set offline store upload policies. Once the policy is enabled, the device user can upload the local offline store files to the server for the developer to analyze or troubleshoot, subject to the upload policy settings. Specify policy properties.

      Offline Store Upload Policy Properties

      Property Default Description
      Delete Offline Store After 7 days The time to elapse before the offline store files are deleted automatically. This security measure protects the device user, but be sure to allow enough time for the developer to perform the troubleshooting or analysis. The maximum value is 30 days. For legacy configuration values that are more than 30, the value is changed to 30 automatically.
      Maximum Offline Store Size 32 MB The maximum size allowed for the offline store files.
  6. Select the Offline Stores tab to view the uploaded offline stores.

    You see the list of existing offline stores that are available in offline settings. You can also view the Unique ID, Device ID, Created By, File Size, Creation Data, and the Actions you can perform for each offline store. You cannot modify these values, but they are useful for finding and sorting offline stores.

    Offline Stores

    Properties Descriptions
    Unique ID The unique identifier for the offline store.
    Device ID The device identifier associated with the offline store.
    Name The offline store name.
    Note Note Text notes about the offline store, up to 120 characters.
    By Creator of the offline store.
    File Size (KB) The current offline file size in KB.
    Creation Date (UTC+0800) The offline store creation date in UTC format.
    Actions Actions that can be taken, such as deleting the offline store.
  7. To download an existing offline store, click the download icon.

  8. To delete an existing offline store, select the corresponding check box, and click the delete icon.

  9. Select Save.

  10. Select Info to see feature details, such as useful URLs.

Editing the Application Configuration File

Use the Offline editor to make updates to the application configuration file. You can view base endpoint properties for the selected offline application, and set some custom parameters in the application configuration file using SAP mobile service cockpit.

An example of a custom parameter is to disable CSRF for the development and test environment, using the disable_fetch_csrf_token_request property described in step 5. Create a key-value pair using Y to disable CSRF Token protection. This is not supported in a production system because of security reasons, but is useful in a QA, development, or test system.

Another example of a custom parameter is to enter before and after defining requests at the end-point level, using the before_function and after_function properties described in step 5. The offline service sends separate requests to the back-end server based on this configuration.

To learn more, see Application Configuration File (iOS) and Defining an Application Configuration File (Android).

  1. In SAP mobile service cockpit, select Mobile Applications > Native/Hybrid.

  2. Select an application, then select Mobile Offline Access under Assigned Features (or add it first).

    On the Configuration tab, any offline data store destinations are listed.

    Destination Properties

    Property Description
    Destination The offline client endpoint destination, such as com.<domain>edm.sampleservice.v2.
    State The current state of the destination, such as No Custom Settings or Configured.
    Action The action to take such as Create, Edit or Delete.
  3. Select the create icon.

  4. Specify endpoint properties, and click Next.

    Endpoint Properties

    Property Description
    Destination Name (Display only) The destination name cannot be modified.
    Prepopulates Offline Data Whether to prepopulate offline data on the client. Select Yes, No or Shared-only. If you select No, then in the analytics chart, the average initial download time will be less than the average refresh download time.
    Data Refresh Interval How often to refresh the data on the client when online, in minutes.
    Service Document Format The acceptable service document format to use for the OData back-end server. You can enter a customized value as a string, such as application/name, or you can select application/atomsvc+xml, application/xml or application/json.
    OData Communication Format The format used, such as application/json;q=1,application/atom+xml;q=0.5.
    Delta Communication Format A subset of the OData communication format, such as application/atom+xml.
    Database Collation Character set for database collation, such as UTF8BIN.
    Database Case Sensitivity Whether database case matters; select to enable case sensitivity.
    JSON Date Time Offset The date-time offset format, such as UTC or Defined by Offset Portion.
    Local Data Expiration How long to keep local data before it expires, in hours.
    Allow Omitting Max Length Whether to limit the maximum length of an entry; select to impose no maximum length.
    Content ID Header Location Content identifier header, such as Mime or Operation.
    Number of Max Delta Resends The maximum number of resends allowed for changes, such as 5.
    Batch All Defining Requests Whether to batch all requests when online.
    Delta Tracking Whether to track changes. Specify Auto, Always, or Never.
  5. In Endpoint Customized Properties, click add to add private parameters, and then click Next.

    Create key-value pairs for the parameters.

    Endpoint Customized Properties

    Property Description
    Key The key, such as disable_fetch_csrf_token_request.
    Value Its value, such as Y.
    Action The action to take, such as Create or Delete.

    For example:

    • check_repeatable_requests ‒ enter Y to check requests.

    • disable_fetch_csrf_token_request ‒ enter Y to disable token requests.

    • force_medialink_absolute_url ‒ enter Y to enforce absolute URLs.

    • skip_nullable_relationship_check ‒ enter Y to skip relationship checks.

    • throttling_threshold_initial_download ‒ enter a value to establish the threshold for throttling initial download, such as 11.

    • throttling_threshold_upload ‒ enter a value to establish the threshold for throttling upload, such as 22

    • throttling_threshold_delta_download ‒ enter a value to establish the threshold for throttling delta download, such as 33.

    • media_link_prefix ‒ enter a prefix to use for media links, such as test2.

    • generate_implicit_entity_id_in_response ‒ enter Y to generate an entity ID.

    • disable_fetch_csrf_token_request ‒ enter Y to disable CSRF token protection. This is not supported in a production system because of security reasons, but is useful in a QA, development, or test system.

    • service_document_format ‒ enter the service document format as a string, such as application/json or application/xml.

    • before_function and after_function ‒ enter before and after function to defining requests at the end-point level. The offline service sends separate requests to the back-end server based on this configuration. Sample key-value pair entries:

      before_function=GetProductsByRating?rating=3

      after_function=GetProductsByRating?rating=4

  6. In Client Indexes, click add to add the client index parameters, and then click Next.

    Client Index Properties

    Property Description
    Index The client index name.
    Properties The client index properties.
    Action The action to take, such as Delete.
  7. In Defining Requests, click add to add the defining request parameters, and then click Next.

    Request Properties

    Property Description
    Name The defining request name.
    Refresh Interval (min) The interval time, in minutes, between downloads of the shared data.
    Delta Tracking Specify how to track OData deltas: Auto, Always, or Never. Delta tracking can improve performance on the client.
    Token Lifetime (min) The time, in minutes, until the OData delta token expires. While valid, only changed data is downloaded to the offline store. When the delta token expires, the entire data set is replaced.
    OData Communication Format Specify the format to use for OData payload non-delta requests at the defining query level. For example, some back ends such as Gateway require that you use XML and not JSON. With this property you can configure an efficient defining query with a JSON content type. You can select one of the pre-defined query options: application/atom+xml, or application/json. Or you can write your own. Be sure to set a value if you write your own, or it will be left empty. If no configuration is provided, the destination level configuration is used.
    Delta Communication Format Specify the format to use for OData payload delta requests at the defining query level. For example, some back ends such as Gateway require that you use XML and not JSON. With this property you can configure an efficient defining query with a JSON content type, even if you're using a Gateway back end without delta support. You can also configure a Gateway back end with delta support using XML. You can select one of the pre-defined query options: application/atom+xml, or application/json. Or you can write your own. Be sure to set a value if you write your own, or it will be left empty. If no configuration is provided, the destination level configuration is used.
    Share Data Whether data is shared among different clients or users.
    Action The action to take, such as Delete.
  8. In Defining Request Groups, click add to add the defining request group parameters, and click Finish.

    Request Group Properties

    Property Description
    Request Names Select one or more defining requests.
    Action The action to take, such as Delete.

Defining Network Synchronization

Define the policy for synchronizing application components on various channels, including WiFi, mobile networks, and roaming. The developer must include a user interface on the client app for users to configure when to synchronize large data uploads. This feature is available only for apps created with SAP BTP SDK for iOS and SAP BTP SDK for Android.

This feature lets administrators control synchronization behavior for each app from the cockpit, by indicating when it is okay for data-heavy SDK components to synchronize. Eligible components include:

  • Analytics
  • Client resources
  • Logs
  • Offline OData

To define the network synchronization policy:

  1. In SAP mobile service cockpit, select Mobile Applications > Native/Hybrid or SAP Mobile Cards.

  2. Select an application, then select Mobile Settings Exchange under Assigned Features.

  3. Under Network Synchronization Policy, select Enable Network Policy.

  4. For each component in the list, select each network channel to use for synchronizing data.

    Network Synchronization Policy

    Policy Description
    Component The component that's impacted by the network synchronization policy (such as Analytics, Client Resources, Logs, and Offline OData).
    WiFi Indicates whether synchronization should automatically occur over WiFi.
    Mobile Networks Indicates whether synchronization should automatically occur over mobile networks. Network provider charges may apply.
    Roaming (Android only) Indicates whether synchronization should automatically occur while roaming. Network provider charges may apply.
  5. Select Save.

Enabling Shared Devices

(Native SDK only) For environments where employees share devices, you can enable the uploading of pending changes from previous device users. This is useful in case employees forget or are unable to upload their work.

This feature is intended for environments where devices are shared, such as when employees share devices over multiple work shifts. The upload can be executed in the back end, and the next employee can continue work the next day. The feature ensures security, so that users only receive their own messages, not messages intended for a previous user. The feature must be enabled for the application.

  1. In SAP mobile service cockpit, select Mobile Applications > Native/Hybrid.

  2. Select an application, then select Mobile Settings Exchange under Assigned Features.

  3. Under Shared Devices, select Allow Upload of Pending Changes from Previous User. When you enable this feature, you also enable multiple user mode for the client via the QR code.

  4. Select Save.


Last update: July 30, 2021