It is easy to interface the Google data API by using the library Google supply, for .NET too. Let’s have an example of acceding the contacts information:
public class ContactFetcher
{
public event EventHandler<ContactFetchEventArgs> ContactFetch = delegate { };
public void BeginFetchAll(string user, string password)
{
ContactsService svc = new ContactsService("MyApp");
svc.setUserCredentials(user, password);
List<ContactEntry> contacts = new List<ContactEntry>();
int i = 0;
svc.AsyncOperationCompleted += (s, e) =>
{
foreach (ContactEntry entry in (e.Feed as ContactsFeed).Entries)
{
ContactFetch(this, new ContactFetchEventArgs
{ Contact=entry, Current=++i,Of=e.Feed.TotalResults });
}
if (e.Feed.NextChunk != null)
{
svc.QueryFeedAync(new Uri(e.Feed.NextChunk), DateTime.MinValue, this);
}
};
svc.QueryFeedAync(new Uri(ContactsQuery.CreateContactsUri(user)), DateTime.MinValue, this);
}
}
public class ContactFetchEventArgs:EventArgs
{
public ContactEntry Contact { get; set; }
public int Current { get; set; }
public int Of { get; set; }
}
This class requires the following references:
Google.GData.Client
Google.GData.Contacts
Google.GData.Extensions
All these are available in precompiled form after installing the Google Data API setup. Of course, the complete API contains a method to interact with a lot of good things in addition:
- Blogger
- Calendar
- Calendar Resource
- Code Search
- Contacts
- Content API for Shopping
- Documents List
- Email Audit
- Email Settings
- Google Analytics
- Google Apps Provisioning
- Google Health
- Google Webmaster Tools
- Notebook
- Picasa Web Albums
- Spreadsheets
- YouTube
The only missing point: there is no (not yet) a version for WP7, and the current codebase is not easy to port. Another missing point is that the API does not support OAuth2, that is indeed supported by the Google platform itself.

