Syncing Kontact with Android
I recently became the proud new owner of an Android phone, or more specifically the Samsung Galaxy S i9000. Upon purchase it was promptly rooted and had a custom rom flashed onto it. Also recently KDE 4.6 was released and after a night of compiling I was sitting at a sparkling new desktop and customising it.
But this post isn’t about KDE 4.6 and nor is it about roms and galaxys. It’s about Kontact 2, part of KDEPIM 4.6 (which is still considered unstable by upstream) and how to achieve the state of PIM-zen which everybody should achieve once in their lives. The state of PIM-zen, for those too lazy to click, is the state where your PIM data (calendar/todo/contacts/feeds/etc) is accessible through any digital medium, be it your desktop’s PIM applications, a website visited from a remote location, or your mobile phone’s bundled PIM-suite.
Syncing your Calendar and events
I’m not going to talk about syncing email, as that has been covered countless times elsewhere. So let’s start with syncing the calendar, as it is the next most prevalent in use. Google phones unsurprisingly sync well to Google accounts – and given that Google accounts have a web-based frontend too, this kills two birds with one stone in our “access everywhere” requirement of PIM-zen. So our solution is going to be Kontact 2 <–Sync–> Google’s PIM Suite <–Sync–> Android device.
Kontact 2 is completely Akonadi based. In comparison to Kontact 1, where there was a makeshift Akonadi-resource wrapper which you could add to harness Akonadi as a data source, Kontact 2 only uses Akonadi-supported sources for your data. Luckily Akonadi makes it easy to connect to data sources, and so there is a specialised Akonadi-GCal-resource which you can add.
To do this, just right click on the bottom left box in Korganizer which holds the calendar sources, click “Add Calendar”, and select “Akonadi Google Calendar Resource”.
To get the resource, you may need to install the akonadi-googledata package. After clicking OK, all that remains is that you enter in your Google username (your email), and your Google account password. It should then start syncing and working flawlessly. Your Android phone can then sync to your Google account’s calendar.
However GCal is very buggy it seems as it isn’t unlikely that you’ll be having problems such as unable to authenticate or unable to grab calendar data. After scouring the web here are a few potential solutions to problems you might have:
- Add the resource through the Akonadi configuration, not through Korganizer’s Akonadi wizard.
- Ensure you have suffixed @gmail.com (even if you have an @googlemail.com address) to your username.
- Make sure you don’t use special characters (non-alphanumeric) in your password.
- Use the latest version of libgcal (>0.9.3 should be good enough)
- Remove any older version of libgcal.
- If you are behind a proxy, set it properly in KDE’s system settings -> Network -> Proxy, if not, ensure it is “Connect to internet directly”. (OpenSuse’s defaults to using env variables)
- Ensure you have ca-certificates package installed, and the certificate from https://l.google.com/ to the list of accepted certs.
- Have at least one event in the Google Calendar or it won’t sync (bug).
- Sign out all other account sessions as detailed here.
- … and of course, make sure Akonadi is running. (
If it doesn’t work, you may want to stop akonadiserver, then start it with
akonadictl start &> log in order to get a logfile. You can then poke around to see exactly where it failed. #akonadi on freenode may be able to help.
If it still doesn’t work, don’t despair (it didn’t work for me either!), as there is an alternative sync. The alternative uses CalDAV, as opposed to directly using Google’s Data API. To use it, just select “DAV groupware resource” from the wizard from the same screenshot shown above. However when it asks for you to pick the groupware server, click Cancel. This will prompt you to enter the details manually. Now follow the instructions by Google for SunBird for setting up a CalDAV resource, and as shown below in the screenshot, then after pressing OK things should starting syncing fine.
Finally, we should note that there might be some data loss, as Google Calendar doesn’t implement all of the data fields, such as attendees to events. Another thing you might want to note is that exporting your existing KOrganizer calendar into ical/ics and then importing into Google Calendar may not work, as KOrganizer doesn’t follow the ical/ics specs properly. If you are exporting and are manually modifying the ical/ics file such that it works, ensure you define the timezone, otherwise chaos will ensue :D
Syncing your contacts
Android has, just like Calendar, a built-in autosync with your Google account’s contacts. Akonadi also has a Google Contacts resource, which you may use in similar fashion to the Google Calendar resource described above. Unfortunately it doesn’t work with me, and so I’m currently in the process of debugging it with Savago in #akonadi. YMMV, and I don’t know any good alternative to syncing this.
Syncing your todo lists
This is a pain. First off it should be plainly stated that Google’s Android does not have a stock to-do application. Google’s own laughable implementation of a to-do webapp in GMail is – well, I would use the most derogatory adjectives I could think of to describe it, but that would just mislead you into thinking that it is possible to quantify the horribleness of it (which it isn’t) – oh, where was I? Oh yes, Google’s to-do webapp doesn’t allow you to access it via ical or any sane format, is missing a ton of useful meta-tags which some people might want, and so you should probably scratch out trying to sync over Google’s to-do webapp.
The options do you have are limited to what exists on the Android marketplace to read your todo lists. The two major ones are Astrid Tasks and RememberTheMilk, both of which are very good. Let’s cover RTM first.
The biggest downside with RTM is that in order to use the Android application for it (which is very good), you have to be a RTM Pro user, which costs 25$ a year, which is actually worth it if you are really dependent on task lists. Alternatively you could use their mobile barebones webapp which looks ugly but gets the job done. Their main webinterface is probably the only webinterface I actually really enjoy using, but the downside is that you cannot interact with your tasks via KTodo – you get only readonly access via an iCal file (note that you can also use a version where your todo items are converted to events in your iCal file for use through the KOrganizer interface). So the final setup goes somewhat like this RTM Android App <– Push/scheduled syncs –> RTM Website and/or Google Calendar <– Read-only iCal file –> KTodo. It should be noted that RTM supports syncing with your Google Calendar as well, so that’s an added plus if you want to use that interface. Note that there is also a RTM Plasmoid, which just adds icing to the cake.
The alternative is Astrid Tasks. Whilst interfacewise a little more clunky it still does get things done. It can sync with a “space” on the online saas Producteev, which in turn allows you to manage it from there. It also does a two-way sync with Google’s to-do webapp, but is known to be buggy, YMMV. However from there it doesn’t seem to have a way to sync with KTodo. Luckily, in a twisted sort of way, it does allow you to sync to RTM via a now unofficial sync (due to RTM’s policies of not allowing other companies to make added profit from their system), and using RTM you can then do the same sync as above. However if you use Astrid Tasks even with syncing to RTM, you don’t need to be a RTM Pro user and hence everything is free. Your options are therefore Astrid Tasks Android App <–> Producteev/Google, or Astrid Tasks Android App <–> RTM <– Read-only iCal file –> KTodo.
There is a third alternative – GTDAgenda. This webapp closely follows the original principles of Getting Things Done by David Allen. It’s a really powerful tool and comes with both a mobile site and Android application too. The only downside is that they are rather expensive and their free version is rather stripped down. Even when stripped down it does seem a little overkill for my needs, but it might be different for you.
My personal reccomendation is to just go with RTM.
Syncing your RSS feeds
Syncing your RSS feeds are a little tricky now that Akregator’s Google Reader sync is unmaintained and broken. Also Google doesn’t have a stock feeds application (why, oh why, Google, do you leave out the basics!) – update: actually it turns out they have recently published one. This pretty much limits you to running any Android app which syncs with Google Reader (there are a few out there, I personally use Pulse) – or you could just access Google Reader’s mobile application, which is really attractive for a mobile site I must say.
In the meantime, get somebody hacking on Akregator and fix that sync plugin!
… and reach your state of PIM-zen!
I hope that this guide has been helpful to those wanting to achieve that perfect sync across all their devices. Any tips and tricks I missed out please let me know in the comments.