Windows Mobile Calendar Sync

On July 22nd, 2009 19:13 • In Tech • By Oliver
Tags: , , , , ,

Till about one week ago, I often had my cellphone and a PDA with me. One for communication, the other for organisation (games, appointments, tasks, notes and stuff). But since the PDA is another gadget I have to carry around, I didn’t use it as often. And ever since I switched my online calendar, the syncing didn’t work anymore as well (and I was too lazy busy to work on it).

Last week I renewed my plan with the provider and took the chance to get my hands on a XDA Diamond 2 (a minor variation of the HTC Touch Diamond 2). With this I only need to take one device with me. But to fully use it, I have to work around a few handicaps of the smartphone (i.e. Windows Mobile). The major part would be the calendar synchronisation.

Initial situation

Several Calendars: My private calendar (Horde Kronolith), the calendar at work (eGroupWare) and a few other local iCalender files (ics) at work. All of them are imported as iCal into Thunderbird/Lightning which manages all of those calendars.

New to that bunch: The smartphone

Let’s do it!

Of course, first comes a little research. Since I manage the calendars in Lightning and use the iCal format for that, I want to stick to that. But as I feared, Windows Mobile has still no idea how to handle iCal and of course it also has no idea how to handle SyncML. As it seems, Funambol provides still the best solution for my needs. So nothing has changed in the last years. At least the Funambol solution got more advanced and gives me new possibilities.

Everything of Funambol needs to be installed. The server (for now on the workstation) and the clients/Add-Ons for Windows Mobile and Lightning. (Server and Windows Mobile download, Lightning Download) The server doesn’t need to be configured for this simple one-user solution. As for the clients, one needs to enter the same login data and the same remote names.

The local communication with the smartphone under Windows goes over Active Sync. One could also just create a network connection, since the Funambol server is running Tomcat, but for now, let’s stick to local sync.

To my surprise, the synchronisation of the contacts worked immediately and I could use Thunderbird to clean up my contacts (SIM based contacts suck). The calendar somehow worked, but there were still some problems.

The major problem would be that I can sync only one calendar with Funambol (probably because Windows Mobile can only handle one), but I have several of those in Lightning. This is where it gets a bit tricky. I need to find a way to merge those calendars into one, without mixing it up with the others.

Automatic Export is an Add-On for Sunbird/Lightning that saves calendars to ics files. Now I got all my calendars on my filesystem, but they are still in several files. Searching for a way to merge those didn’t give me working results. There is a python script out there, which ought to do this, but I didn’t get it to run. Mostly because it was written in Python 2.6 and I am using 3.1 (the same goes to a library used by the script). Adapting it didn’t work out, since there seem to be other problems as well. So I used a lunch break to codethe a simple python script myself. Since the files all share the same export source I didn’t need to give a damn about formats and stuff. The script just parses the ics files, extracts all VEVENTS, puts the iCal header information around it and saves it as a new file. A really simple makeshift solution, you can download it, if you want.

Download: Simple iCal file (ics) merger (for Python 3)

The Automatic Export Add-On can run a command after saving the files, so just entering the python path and the script as a parameter allows me to do this all in one run.

The file with the merged calendars is integrated as a new calendar into Lightning. (Hidden and not exported.) Now the configuration of the Funambol client has to be set to the new calendar and ta-da, it works. Now all my dates/events/appointments are synced onto my smartphone.

Result

Well, I got my calendars into Windows Mobile. The only thing that doesn’t work is getting the changes and adds I do on my smartphone back into the original calendar. For the moment I can live with that, but of course I will try to find a solution for that as well. But after the update to Windows Mobile 6.5, who knows how that will disrupt my makeshift solution anyway. There also seems to be a little quirk with changing existing entries after the first sync of them. Sometimes the change doesn’t go onto the phone and some are not deleted, but I will look into that another time as well.

To do

Well, this is just the solution for the Windows workstation at work (since right now I can only access my work calendars here). So I still have to adapt this to my Linux system at home. Having a central server on the interwebs would be better. Especially if I could do it with CalDAV or even GroupDAV. I already got some basic ideas how to do this, but since I cannot do this in a few lunch breaks, I need time. We’ll see if I can do it before I switch my cellphone again in 2+ years. Oh and I didn’t try to sync tasks so far.

3 Responses to “Windows Mobile Calendar Sync”

  1. Joerg Says:

    Hi Oli,

    I setup an CalDav Server (Davical) last night. There you can share Calender Information with other persons or Devices. Curious about it?

  2. Oliver Says:

    Hi Jörg,

    sure I’m curious. DAViCal would’ve been my choice for this later project anyway, since I want to use it as some kind of middleware server without having another calendar to worry about. Unfortunally setting up the server will be the easier part compared to all the scripts I need to code, but hey, I’m sure it’ll get interesting ;) . Tell be about it on Wednesday.

  3. Ronny Says:

    I tried to do the same steps as you did. My problem is, that, if there’s a change in the merged ics file, which I import into Sunbird, Sunbird shows the change correctly, but the funambol client does not sync it.
    If I do the changes directly in sunbird, everything works fine.

    Any suggestions?

Leave a Reply