Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Portable Class Libraries for Google APIs

Portable Class Libraries for Google APIs

Lire ce contenu en français

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.

Rate this Article