Configuring Sync Descriptor
Sync Descriptor is the one which define synchronization of data through service.
<!-- Sync Descriptor Design -->
<sync-descriptor>
<!-- Mandatory Field -->
<property name="name">name_of_sync_handler</property>
<!-- Optional Field -->
<property name="sync_interval">sync_interval_in_millisecond</property>
<!-- Optional Field -->
<!-- Default: SCREEN -->
<property name="type">INTERVAL|SCREEN|INTERVAL-SCREEN</property>
<!-- Service Descriptors -->
<!-- Service Descriptor -->
<service-descriptors>
<service-descriptor>name_of_service_descriptor.name_of_api</service-descriptor>
</service-descriptors>
</sync-descriptor>
<!-- Android Sample: Sync Descriptor -->
<sync-descriptor>
<property name="name">SYNC-BOOKS</property>
<property name="interval">5000</property>
<service-descriptors>
<service-descriptor>SIMINOV-CONNECT-BOOKS-SERVICE.GET-BOOKS</service-descriptor>
</service-descriptors>
</sync-descriptor>
<!-- iOS Sample: Sync Descriptor -->
<sync-descriptor>
<property name="name">SYNC-BOOKS</property>
<property name="interval">5000</property>
<service-descriptors>
<service-descriptor>SIMINOV-CONNECT-BOOKS-SERVICE.GET-BOOKS</service-descriptor>
</service-descriptors>
</sync-descriptor>
<!-- Windows Sample: Sync Descriptor -->
<sync-descriptor>
<property name="name">SYNC-BOOKS</property>
<property name="interval">5000</property>
<service-descriptors>
<service-descriptor>SIMINOV-CONNECT-BOOKS-SERVICE.GET-BOOKS</service-descriptor>
</service-descriptors>
</sync-descriptor>
<!-- JavaScript Sample: Sync Descriptor -->
<sync-descriptor>
<property name="name">SYNC-BOOKS</property>
<property name="interval">5000</property>
<service-descriptors>
<service-descriptor>SIMINOV-CONNECT-BOOKS-SERVICE.GET-BOOKS</service-descriptor>
</service-descriptors>
</sync-descriptor>
Note: Application Developer can provide their own properties also, and by using following API's they can use properties.
Get Properties - [Android:getProperties | iOS:getProperties | Windows:GetProperties | JavaScript:getProperties]: It will return all properties associated with Application Descriptor.
Get Property - [Android:getProperty(Name-of-Property) | iOS:getProperty:Name-of-Property | Windows:GetProperty(Name-of-Property) | JavaScript:getProperty(Name-of-Property)]: It will return property value associated with property name provided.
Contains Property - [Android:containsProperty(Name-of-Property) | iOS:containsProperty:Name-of-Property | Windows:ContainsProperty(Name-of-Property) | JavaScript:containProperty(Name-of-Property)]: It will return TRUE/FALSE whether property exists or not.
Add Property - [Android:addProperty(Name-of-Property, Value-of-Property) | iOS:addProperty:Name-of-Property value:Value-of-Property | Windows:AddProperty(Name-of-Property, Value-of-Property) | JavaScript:addProperty(Name-of-Property, Value-of-Property)]: It will add new property to the collection of Application Descriptor properties.
Remove Property - [Android:removeProperty(Name-of-Property) | iOS:removeProperty:Name-of-Property | Windows:RemoveProperty(Name-of-Property) | JavaScript:removeProperty(Name-of-Property)]: It will remove property from Application Descriptor properties based on name provided.
-
name*: Name of Sync Descriptor. It is mandatory property.
-
sync_interval*: Sync Interval related to Sync. It is optional property.
-
type*: INTERVAL|SCREEN|INTERVAL-SCREEN. Type of Sync. It is optional property.
-
Services*: Name of services include under the Sync Descriptor.
Note:
Name of the service descriptor.
Name of the API needed for sync in Service Descriptor.
Put (dot). between service name and api name.
![Application Data Folder Based On Name Defined] (https://raw.githubusercontent.com/Siminov/connect/docs/github/v2.0/sync_descriptor_path.android.png "ApplicationDescriptor.xml file path")
![Application Data Folder Based On Name Defined] (https://raw.githubusercontent.com/Siminov/connect/docs/github/v2.0/sync_descriptor_path.ios.png "ApplicationDescriptor.xml file path")
![Application Data Folder Based On Name Defined] (https://raw.githubusercontent.com/Siminov/connect/docs/github/v2.0/sync_descriptor_path.windows.png "ApplicationDescriptor.xml file path")