Improvements to the Google Play Services Component

Avatar

Tom

We made some changes to the Google Play Services component that will make it even easier to utilize Google Play Services in your Xamarin.Android application.

Automatically Downloads Google Play Services Client Library

The first improvement is that the component is no longer dependent on the Google Play Services client library installed on your workstation. The Google Play Services component embeds metadata to identify what version of the Google Services client library it is bound to. When you add the component to your application, the correct version of the Google Play Services client library is downloaded and the component automatically binds to that, instead of the version that is installed by the Android SDK Manager.

Three Different Versions

Now that the Google Play Services component can manage the version of the Google Play Services client library it needs, the only thing you need to concentrate on is the minimum version of Android your application will support. Just pick one of these three components:

  • Google Play Services – This component is meant for projects that target Android 4.0 (API level 14) or higher.

  • Google Play Services (Froyo) – This component is for projects that target Android 2.2 (API Level 8). In November, 2013 Google stopped supporting Android 2.2 in the newer versions of Google Play Services. You can still use the existing Google Services in your Android 2.2 app, but you won’t get any of the latest bug fixes or features.

  • Google Play Services (Gingerbread) – This component is for projects that target Android 2.3 (API level 10).

Screenshot 2013-12-09 14.58.24

Automatically References Dependencies

The previous versions of the component required you to manage dependencies, specifically the Android Support Package. The latest update takes care of this for you, by including the relevant dependencies:

If you’re already using the component in an existing project and have a reference to Mono.Android.Support.v4 or Mono.Android.Support.v7, you’ll have to remove these old references when you upgrade to the latest version of the component.

If you’re new to the Google Play Services component, why don’t you get the Maps And Location Demo v3 sample from GitHub and try things out for yourself?

Discuss this blog post in the Xamarin Forums

Avatar
Tom Opgenorth

Follow Tom