×
Namespaces

Variants
Actions

SyncML Client API

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: ltomuta (16 Jun 2007)
Last edited: hamishwillee (30 May 2013)


Note.pngNote: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

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

File:SyncCliSamEx.zip


Related Links:

This page was last modified on 30 May 2013, at 04:36.
63 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×