Updating Google Calendar with MS Project Tasks – Revisited

Back in 2008, wrote the post on Updating Google Calendar with MS Project. Since then, lot many people had asked for the code, and myself felt that getting the code on github would be great. I shall keep complete the post in 2 parts, starting with setup, listing the calendars and then winding up with updating Google Calendar with MS Project entries.

To begin, you can get the code form github at following location


Building the code

To build the code and download the dependencies, please refer to the wiki page https://github.com/paliwalashish/mpputils/wiki/Build

Retrieving Calendar's

Now lets move to retrieving the list of all the Calendar's for a user
The code is simple enough, here is the function which does the

public static List<CalendarEntry> getAllCalendars(String userName, String password) throws Exception {
        CalendarService myService = new CalendarService("CalendarService-"+userName);
        myService.setUserCredentials(userName, password);

        // Send the request and print the response
        URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/allcalendars/full");
        CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);

        return resultFeed.getEntries();

This snippet shall return all the Calendar's for the specified user account.

The code has an example of using the same. Please refer to com.ashishpaliwal.mpputils.examples.ListAllCalendars class on the usage.

In the next part we shall see the code for updating of Google Calendar with MS Project task.

2 thoughts on “Updating Google Calendar with MS Project Tasks – Revisited

Leave a Reply

Your email address will not be published. Required fields are marked *