SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

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

Offline-Enable Your Android Application

Enable offline OData in your Android application, resulting in an application that can be used without a network connection and that performs data requests with less latency.

Overview

🎓 beginner 30 min. SAP BTP Sdk For AndroidBeginnerAndroidMobileOdataSAP Business Technology Platform

You will learn

  • How the offline feature works, through demonstration
  • How the synchronization code works
  • How to handle errors that occur while syncing
Bruce Meng B Bruce Meng January 7, 2026
Created by November 17, 2022
Contributors

Prerequisites

Steps

Step 1 Generate and run an offline app

  1. Follow the instructions at Try Out the SAP BTP SDK Wizard for Android to create a new application using the SAP BTP SDK Wizard for Android and select Offline for the OData option on the Project Features tab. The push feature is not needed for this application.

    Choose Offline OData
    Choose Offline OData

  2. Run the app. After the login process, a screen is displayed explaining that the offline store is opening. As the screen suggests, opening the offline store for the first time can take up to a few minutes. One technique to decrease this initial time is to only download data that is relevant to the user, such as customers that belong in their sales region.

    Offline store opening
    Offline store opening

  3. When you get to the app’s home page, turn on Airplane mode on your device, or disable Wi-Fi and data.

    Turn on Airplane mode
    Turn on Airplane mode

  4. The entity list screen is populated based on the metadata.xml file retrieved when the application was created. Tap the Products list item.

    Entity list screen
    Entity list screen

    The Products screen makes a data request to display the available products. Notice that it succeeds without a working network connection. The data request is fulfilled from the offline store that was previously created and populated on the device. Tap the Accessories item to display the detail screen.

    Select the first product
    Select the first product

  5. On the detail screen, tap the edit toolbar icon.

    Select product edit button
    Select product edit button

  6. Make a change to the currency code and tap the save toolbar icon.

    Change currency code
    Change currency code

  7. Navigate back to the app’s Home screen and tap Synchronize using the three-dot-menu in the top right of the title bar.

    Attempt a sync
    Attempt a sync

    The sync should fail because you haven’t turned airplane mode off yet.

    Sync fails
    Sync fails

  8. Turn off airplane mode or re-enable Wi-Fi/data and attempt a sync again. You will see a notification that describes the sync action.

    Syncing notification
    Syncing notification

    When the sync completes, the change you made will have been applied to the back end.

Step 2 Examine the encryption key
+
Step 3 Examine the defining queries
+
Step 4 Examine the offline service and service manager
+
Step 5 Try to introduce a synchronization error
+
Step 6 Display `ErrorArchive` details
+

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. Generate and run an offline app 2. Examine the encryption key 3. Examine the defining queries 4. Examine the offline service and service manager 5. Try to introduce a synchronization error 6. Display `ErrorArchive` details

Learn more →