Hi Zhoulei, On Mar 29, 2012, at 5:45 , zhou lei wrote:
> In the configure XML file, I set the datastore name to "contacts" which is > named "test_contacts" before. And in it, change the displayname to > "contacts", set the plugin_module to "iPhone_dbplugin1" which is named > "SDK_textdb". Is that correct? That's correct. However, I tried it myself and as you found, there's still that Error 20010, which means that something is wrong in the XML config. Unfortunately, the sample app did not output the config error messages to the console as it should have. I fixed this, please see the lastest commit in the luz branch on gitorious (the config variable "conferrpath" must be set to "console"). With this, the XCode debug console shows what is the problem: Fatal: Module does not understand params passed in <plugin_params> This is because the sample uses the <datafilepath> <plugin_param>, which is specific to the SDK_textdb plugin, and is not understood by the dummy plugins. So just comment out or remove the entire <plugin_param>, and the sync engine will initialize correctly. In the same commit, I also added a line to enable syncml engine logs to tmp/sysynclogs for DEBUG builds, so it is easier to get started with the sample and see what the SyncML engine is doing. > When i using the sqlite, i found out that there is no place to set the key > "prefs_path", The prefs_path just returns the default directory for the platform to store preferences, so you can use it in the XML config or your app to avoid hard-coded paths. > and in the sdk document, so should i set it as a defout path to create a > SQLite db file? You just need to set the <sqlitefile> to a path where your SQLite database is. You could use the $(prefs_path) variable to specifiy that path relative to the default preferences location, but you can also use a absolute path. The SyncMLClient class defines a config variable called $(sandbox) to contain the App's sandbox directory, because that's usually the starting point you need. So usually you would define the SQLlite file like: <sqlitefile expand="yes">$(sandbox)/Library/mydatafile.sqlitedb</sqlitefile> > And is there any document for the SQL columns'name for sync. There are too > many columns in the sunbird_client.xml, like "id" "recurrence_id" > last_modified. Is there a really demo, that could work with contacts? The entire point in libsynthesis is that you can adapt it to your own databases. If the sync should be with one of the iOS built-in data sources, there are the (quite complex) commerical plugins for iOS contacts and iOS calendar. If you want to design your own address book, it's up to you to design an alternate address book database. > This demo is hardly to read. And may takes a long time to understand what you > really want to show to us. Sync is complex - there's no easy way. SyncML sync is also a niche, and the iOS opensourcing is quite new. I admit that there's no good tutorial yet, but then, this is OpenSource and anyone is welcome to contribute more samples and docs. If I had to write step by step tutorials myself before opensourcing it, libsynthesis wouldn't be opensource yet. What I'm providing is 10 years of condensed SyncML knowhow, in a library that hides a huge amount of complexity from the user, but still admittedly remains non-trivial, and thus needs some diggin in to learn. > Maybe it is easy for you guys to write out a dbplugin or something else, but > one guy should know how to set configure xml file, should know how to write a > dbplugin, and how to make it runs in the right way, and when it goes wrong he > should know where is wrong. Don't know why you guys don't give a demo that > could really work on ios, and can do a sync, even for only one contacts or > other things. The demo as provided does work on iOS, and as you see I try to improve it to make it more accessible and easier to modify. However, I do this unpaid, and writing all that you seem to expect to just be there would take a lot of time. Opensource works by everyone contributing to a project what he or she thinks is missing, not by one party providing everything for everyone else to use for free. _______________________________________________ os-libsynthesis mailing list [email protected] http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis
