A couple of years ago I had written a guide describing How to synchronize Google contacts and calendar with KAddressbook and KOrganizer. In that guide I had used libgcal and akonadi-googledata from the libgcal project. However in KDE 4.9 there is a much easier way to synchronize your Google Contacts, Calendars and Tasks. For the following guide to work you must have Akonadi running which is done by default in KDE4, unless you have disabled it by yourself.
First we are going to sync our contacts. Press alt+F2 and type in Akonadi Console. This is the main window of Akonadi Console. Press Add at the bottom and from popup window select Google Contacts.
The application Google Contacts will ask to access your kdewallet. Just select Allow Always.
You will be asked to sign in your Google account with your username name and password. Just type them and allow Akonadi to access your Google account.
Next select your Google account from the list and press OK.
Akonadi Google Contacts resource should appear saying it is Ready.
Now just run KAddressbook and select you gmail account from the list. All your contacts and info will be here.
Next we are going to sync our calendar and tasks in KOrganizer. Open again Akonadi Console, press the Add button and from the list select Google Calendar and Tasks.
Once again sign in your gmail account and allow Akonadi to access your data.
Afterwards select the Calendars and Task Lists that you want to access from KDE.
Akonadi Google Calendar resourse should appear saying it is Read.
Now run KOrganizer and select your Calendar and Tasks Lists you want to view in KDE.
That was it. Now you have two way synchronization between KDE and your Google account.