Archive for July, 2009

Google Contacts to vCard (3.0)

Saturday, July 18th, 2009

Today I’ve been experimenting with the Google Contacts Data Data API (for Java). My first project has resulted in code with which I can upload contact photos to Google fairly simple. Quickly after that I created my second project, which exports Google Contacts into vCard 3.0 format, of course including photos. Strangely, this is something which the standard export from Google Contacts can not (yet) do.

Fairly instrumental in the export to vCard project is the iCal4j-vcard project, which has a nice API to manipulate and output vCards. Initially I had some struggles with the VCardOutputter class, which somehow resulted in “I/O Errors”, but for now I’ve just used vCard#toString.

The iCal4j-vcard project is part of the iCal4j project. The iCal4j project implements the iCalendar specification, for creating calendar entries with Java. They also have a good example for using iCal4j with Android.