When you create a mobile application using a Silk UI template, a set of actions and blocks are made available which allow you to quickly implement offline synchronization scenarios.
How to implement offline synchronization
To take advantage of the Silk UI templates to implement offline synchronization scenarios:
1. Implement the data synchronization logic of your application using the
ServerDataSync actions. Check the samples of different data synchronization strategies you can use.
2. Trigger the synchronization logic. To trigger synchronization:
- Automatically: base your application screens in the
LayoutBlankblocks and define the points when you want the synchronization logic to be triggered in
OfflineDataSyncConfiguration, such as when the device becomes online. The template implements logic that takes care of the rest.
- Manually: invoke
TriggerOfflineDataSyncto start the synchronization manually.
The asynchronous processes of data synchronization are carried out in the background.
Template actions and events for offline synchronization
The Silk UI templates provide you the following actions and events to serve as starting points for the implementation of your offline synchronization scenarios:
In the Logic tab, under Client Actions\OfflineDataSync:
OfflineDataSync: action which executes the offline data synchronization.
OfflineDataSyncConfiguration: action where you can configure points to start offline data synchronization automatically and other advanced settings.
TriggerOfflineDataSync: action which starts the offline synchronization process.
In the Logic tab, under Server Actions\OfflineDataSync:
ServerDataSync: action which executes the server-side offline data synchronization.
Screen client actions and events
In the Interface tab, under UI Flows\Common:
OfflineDataSyncEvents: source block for the Layout and LayoutBlank blocks which triggers and handles the relevant events for the automatic synchronization process.