Skip to content

iPhone Address Book Synchronization with SyncEvolution: The Making Of

The iPhone port of SyncEvolution has been publicly available for a week now. Since then Fabrizio has mentioned it in his blog posting about the Apple SDK and announced his Funambol GUI for SyncEvolution on the iPhone. Users have started asking questions about it. Before examining the possible next steps with this exciting new platform for SyncEvolution (after the Evolution on Linux and Nokia 770/800 Address Book versions), let’s take a step back and review how the iPhone port saw the light of day.

At the beginning god created the iPhone… or so some believe when Steve Jobs announce it. I’m not a follower of that particular religion and usually react allergic to hypes, but when Fabrizio offered to send me an iPhone in return for the promise to port SyncEvolution I couldn’t resist. The goal was to have a solid implementation of address book synchronization. With all my contacts maintained in Evolution on Linux, iTunes isn’t much help in that regard.

After experimenting with directly accessing the contacts in the SQLite database that approach was dropped in favor of using the Addressbook framework:

  • the internal database schema is sufficiently complex that reimplementing read/write routines would have been a lot of work and likely led to compatibility issues with the iPhone address book
  • changes to the SQLite database were not detected by the iPhone address book or caused it to crash
  • using the Address Book API would allow to compile the same source also for Mac OS X synchronization, a nice extra because there doesn’t seem to be a SyncML client for Mac OS X

After all, iPhone runs parts of Mac OS X and that API is documented, so how different can it be on the iPhone? Unfortunately the answer turned out to be: quite a lot. From analyzing the libraries on the iPhone it was clear that all of the functions had been renamed. Using them in a way that works on Mac OS X just crashed on the iPhone. Due to the lack of documentation a lot of guessing and trial-and-error was required to figure out all the changes and avoid bugs that still seem to be lurking in normally unused parts of the iPhone libraries.

Besides figuring out how to access contacts on the iPhone the complete conversion to and from a standard format (vCard 2.1) had to be written. On Mac OS X there are library functions for that, but a) they use vCard in a way which is unlikely to be supported well enough by SyncML server and b) these functions are missing on the iPhone. With full control over the conversion process it was possible to minimize data loss to a minimum; see the compatibility entry for the platform for details.

For software on the iPhone a single-click installation is almost a requirement. Once I started with setting up the necessary repository I felt bad about not offering the same convenience to existing users, so I also added an apt repository for Debian/Ubuntu and an .install file for the Nokia Internet tablets.

Fabrizio tested all of these early versions on his own iPhone and provided valuable feedback. When it became obvious that the command line version worked, he was eager to also offer a GUI for it to the less technically inclined users. This time I managed to resist – I was a bit more diplomatic than “I’ve got better things to do” though ;-) But there is some truth to it: for the final 0.7 release the other platforms still need a bit of love and care. It also would be nice to not spend all evenings in front of the computer, even if just for a while.

Luckily that was enough motivation for Fabrizio to do the GUI himself. Now we just need to figure out a way how users can install both easily while at the same time being able to upgrade GUI and SyncEvolution independently: currently the Funambol GUI package contains a full copy of the SyncEvolution files. Therefore installing or updating the GUI after a SyncEvolution update will fall back to an older version of it unless the packages are always in sync. Hmm.

I have dodged an obvious question which came up right after the release: what about calendars? More on that in the next post.

{ 3 } Comments

  1. Joeles | August 11, 2008 at 11:27 am | Permalink

    I thought the iPhone SyncML client is open source, too? But I couldn’t find the sourcecode. Is it availiable somewhere?

  2. Patrick Ohly | August 11, 2008 at 10:27 pm | Permalink

    The source of SyncEvolution for the iPhone is identical with the normal release. It’s just compiled differently. See http://www.estamos.de/projects/SyncML/Installation.html#Compiling+from+Source

    The source of the Funambol GUI that was combined with SyncEvolution in the initial releases was not published as far as I know.

    The current source of the Funambol iPhone plug-in is in the Funambol CVS repository, which is about to be migrated to Subversion.

  3. bradleywas | February 27, 2009 at 12:52 am | Permalink

    I agree with the comments about direct write compatibilities, and use of the addressbook framework. but nonetheless, i’ve written a sample script, using korn shell, to write a vcard record to the iphone’s addressbook. details are at http://pwp.att.net/p/PWP-logic010001.

    The example script can be useful to initialize your iphone addressbook with vcards on your linux workstation.

{ 3 } Trackbacks

  1. [...] at least something could be learned from the Mac OS X documentation although the iPhone was sufficiently different to make the port very tedious. One could try to bypass the API and access the data in the sqlite [...]

  2. [...] I mentioned before, as part of the work for the iPhone SyncEvolution was first ported to Mac OS X. The 0.7 release on [...]

  3. iPhone & Ubuntu notes… | sephiroth.it | June 20, 2010 at 3:14 pm | Permalink

    [...] For a full AddressBook sync you can read more here: http://www.estamos.de/blog/…the-making-of/ [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *