SyncML Client API
Article Metadata
Code Example
Article
Purpose
SyncML client API is SyncML server’s client side API. This provides services to manage data synchronization and device management related data. The services provided are profile management – retrieval of profile file values, setting up of profile values, listing of profiles etc , history of profile , event notification , progress event notification. RSyncMLSession is the Client side handle to server session. We have to create instance of this class before using other classes. RSyncMLDataSyncProfile is a handle to manage Data synchronization profile data.
Use cases
To create Data synchronization profile
One use case is to retrieve or set particular profile values like display name, protocol version and user name.
We can disable further synchronization by setting SetSanUserInteractionL to be ESmlDisableSync.
Example code - to retrieve the profile values
RSyncMLSession syncMLSession;
RSyncMLDataSyncProfile profile;
syncMLSession.OpenL();
// Listing profiles
RArray<TSmlProfileId> arr;
TInt err;
TRAP(err, syncMLSession.ListProfilesL(arr, ESmlDataSync));
if (err == KErrNone)
{
TInt count = arr.Count();
for (int i=0;i<count;i++)
{
//Opening Profile
TRAP(err,profile.OpenL(syncMLSession, arr[i], ESmlOpenReadWrite));
// Sync Profile name
iName.Append(profile.DisplayName());
// similar to this we can set profile name – profile.SetDisplayName
//Connection Setting Values
//Server Version
iProtVers = profile.ProtocolVersion();
enumPVR.AppendNum(iProtVers);
//Server Id
iServerID.Append(profile.ServerId());
//User Name
iUserName.Append(profile.UserName());
//Password
iPassWd.Append(profile.Password());
//Application settings
//Synchronization type
iSyncType = profile.Type();
enumType.AppendNum(iSyncType);
//Profile Id
iProfId = profile.Identifier();
enumPID.AppendNum(iProfId);
//Creator ID
iCreateId = profile.CreatorId();
enumCID.AppendNum(iCreateId);
//Close
profile.Close();
}
}
syncMLSession.Close();
Code to disable furthur sync
profile. SetSanUserInteractionL(ESmlDisableSync)
Example project


29 Sep
2009
SyncML client API's are useful to manage data synchronization. The article listed various service provided by SyncML client API which can be used for more detailed study. This article demonstrates the use of SyncML client API to retrieve the profile values, using profile management service, with code example which helps to understand how this API can be used. Using this code example anyone can easily use other services like setting up of profile values, listing of profiles and create SyncML Data Synchronization profile.
Note that this API, SyncML client API, is not part of the public SDK. So you have to download it from SDK API Plug-in before using it. Furthermore, the author added a working demo project, which can be used for more detailed study of new opportunities for various kinds of experiments.
SyncML Missing!
Why is the SyncML Client API not included in "API Plug-in for the S60 3rd Edition SDK for Symbian OS, for C++, supporting Feature Pack 2"?