Using On-Device Resources
Objectives
After completing this lesson, you will be able to:
- Describe the purpose of on-device storage.
- Create an on-device storage entity and access it from an app.
Purpose of On-Device Storage
On-device storage lets you store information specific to the current user that does not need to be shared with other users. It is available offline without needing to call a back-end system using the internet.
Examples of the type of data that could be stored on-device are:
- Personal settings/preferences for the app.
- Temporary data that is not ready to be sent to a back-end data source.
- Data to allow offline use of the app.
- Data only related to the current user.
The data is stored either on the device (for mobile apps) or in the browser (for web apps), but the most important thing to remember is that the data is only available to the current user since it is stored on their device only.
Create On-Device Storage
Steps
Create a table to store a list of preferences for the current user.
In a new SAP Build Apps project, open the Integration tab.
Go to On-Device Storage and choose Create Data Entity.
In the Name field, enter Preferences (the name of the data entity), and choose Add.
This will open a screen for defining the entity’s fields.
Add the following fields:
For each field, choose Add New.
Enter the name, set the field’s data type to Text, and choose Add.
Choose Save (upper right).
Create a Tracker with on-Device Storage
Business Scenario
Exercise Options