Hi Zhoulei,

On Mar 19, 2012, at 3:57 , zhou lei wrote:

> In my satuation, I  want to sync the address book from the iphone to the sync 
> server, and when needed the client would update the address book from the 
> server. And for now, I just want to make the client works, and would using 
> the syncML server of the google sync.

Be careful and don't expect too much, Google contact sync is one of the less 
stellar SyncML implementations :-(

> For the local address book, it may not been the iphone's but could be a db 
> from sqlite.

If you use SQLite, you don't need to write your own plugin. libsynthesis has 
built-in SQLite3 interface, all you need is creating a so-called mapping 
between the <fields> in the <fieldlist> and your actual database fields. This 
is done in the <fieldmap> section of the <datastore> in the XML config.

Have a look at  /src/sysync_SDK/configs/sunbird_client.xml, this is a sample of 
an interface to a SQLite3 backend. The sample looks a bit complicated because 
of the large scripts handling all the special cases with exceptions etc., but 
for a plain contact database you probably will not need any scripts at all, so 
just a few lines of <map> definitions will do.

> And when I set the dbplugin_module to "iPhone_plugin1" or "iPhone_plugin4", 
> and try to sync, it will do nothing, off cause, there is not any usefull code 
> in the "iPhone_plugin1", but the function there is just been call  ed when 
> install the module. Must i using the session?

All you need to do is filling actual DB access code into the methods in 
sample_dbplugin1.mm that have a comment with //%%% todo, starting with 
startDataReadWithLastToken.

The wrapper code handles all the rest, instantiates the module and database 
contexts, and calls the methods you find in sample_dbplugin1.mm.

Best Regards,

Lukas Zeller, plan44.ch
l...@plan44.ch - www.plan44.ch


_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to