Google has released a new beta of their SDK known as the Google APIs .NET library. This SDK is being offered as a Portable Class Library and covers 45 of Google’s APIs. This allows Google to offer one DLL that works across .NET, WinRT, Windows Phone, and Silverlight.
The Google APIs .NET library is now based on the PCL version of the HttpClient. This offers some significant advantages to the developer over the older versions because it exposes the new Task based asynchronous methods.
The downside of this is that the HttpClient is currently not licensed for use on non-Windows machines. This could be problematic for those who are using Mono to target Linux, iOS, or Android devices.
Google has extended the HttpClient with a class they call the ConfigurableMessageHandler. “This handler supports injection of unsuccessful response handlers, execute interceptors, and properties such as number of tries, application name (to use in the User-Agent header), etc.” The release notes continue,
We also added a BackOffHandler which supports automatically retries in the case of server errors (5xx) or exceptions during an HTTP request. This handler is attached by default to BaseClientService, but you can change this default behavior using the DefaultExponentialBackOffPolicy on BaseClientService.Initializer.
There are a few breaking changes since the 1.3 beta, specifically in the ClientServiceRequest. As per the new .NET design guidelines, the async methods that previously exposed a callback instead return an awaitable Task object.
The third party libraries needed for the Google APIs .NET library need to be installed via NuGet, but the library itself will not be available on NuGet until a future date.
For your convenience, here is a list of the APIs currently supported by the SDK.
- APIs Discovery Service
- Ad Exchange Buyer API
- Ad Exchange Seller API
- AdSense Host API
- AdSense Management API
- Admin Reports API
- BigQuery API
- Blogger API
- Books API
- Calendar API
- Cloud SQL Administration API
- Cloud Storage API
- Compute Engine API
- CustomSearch API
- DFA Reporting API
- Drive API
- Enterprise Apps Reseller API
- Enterprise Audit API
- Enterprise License Manager API
- Freebase API
- Fusion Tables API
- Google Affiliate Network API
- Google Analytics API
- Google Civic Information API
- Google Cloud Datastore API
- Google Fonts Developer API
- Google Latitude API
- Google Maps Coordinate API
- Google Mirror API
- Google OAuth2 API
- Google Play Android Developer API
- Google Site Verification API
- Google+ API
- Groups Migration API
- Groups Settings API
- Orkut API
- Page Speed Online API
- Prediction API
- Search API For Shopping
- TaskQueue API
- Tasks API
- Translate API
- URL Shortener API
- YouTube Analytics API
- YouTube Data API