Content at a glance:
When you enable offline support, a copy of the content type data that you request from the cloud is stored locally on the device. If the device goes offline for some reason, your application can continue working with local data, including updating, deleting, or creating content type items which remain device-local while the device is offline. After the device goes back online, the SDK can synchronize the changes to the cloud without any need for additional code.
The SDK takes care of forwarding your requests to the appropriate data storage—device-local or cloud—based on the current mode. You always use the same API operations.
As a developer, you have several tasks to complete for your application to be offline-ready:
- Initialize offline support
- Select an offline storage option
- Learn how to switch between online and offline mode in your code
- Turn on data encryption for increased security
- Decide on a data synchronization strategy
- Learn how to maintain the app's offline storage
- Find out how to enable offline support for files
- Carefully consider the limitations and implementation recommendations
Offline support enables a number of mobile development scenarios:
- Occasionally connected apps—Those apps rely on data stored in the cloud, but must also be functional without internet connection. Using offline support you can enable this scenario with nearly no additional code.
- Offline cache—Some apps can use offline support as a caching mechanism allowing for better performance and less data traffic.
- Updateable content—Some applications generally do not need to work online, but still rely on cloud data that changes very rarely. You can leverage offline support to store the data locally, making occasional checks for updates. Good examples of such apps are public transport schedule apps, event-accompanying apps, and so on.
Offline support offers these features:
- Global or per-request online/offline mode selection.
- Offline storage selection—you can choose between several options (see Selecting an Offline Storage Provider) for local storage including custom implementations.
- Manual or automatic data synchronization initiation—you can manually request offline data synchronization to the cloud (for example in a function call) or do it automatically (whenever you switch the SDK to online mode).
- Conflict resolution selection—supported strategies include client wins, server wins, and custom.
- Offline data encryption—you can choose to encrypt the data you store on the device or store it as plain text.
- Convenient synchronization events—you can easily design an informative UI by subscribing to the provided synchronization events.
- Transparent API—you use exactly the same API operations in offline mode as you would in online mode. You do not need conditional code to use offline support.
- Good coverage of API data operations—most operations that are supported online are also supported offline. Exceptions: See Unsupported Operations.
- Storing files offline—in addition to the file metadata, you can choose to store the file content offline.
- KendoUI DataSource integration—offline support works seamlessly with the KendoUI DataSource component.