How to update Maps SDK (version 18.0) in Xamarin.Android?

Viewed 519

I am new to Xamarin.Android. I am trying to update the Google Maps SDK for Android (version 18.0.0), which is now available via Google Play services. However, all the documentation on updates use build.gradle and change the dependencies to com.google.android.gms:play-services-maps:18.0.0 , which Xamarin doesn't have. How do I update the Maps SDK in Xamarin?

1 Answers

Xamarin creates and maintains Xamarin.Android bindings for Google Play Services Google also offers a native mapping API for Android. The Maps API is suitable for cases where you want to maintain more control over the mapping experience. Things that are possible with the Maps API include:

  • Programmatically changing the viewpoint of the map.
  • Adding and customizing markers.
  • Annotating a map with overlays.

Unlike the now-deprecated Google Maps Android API v1, Google Maps Android API v2 is part of Google Play Services. A Xamarin.Android app must meet some mandatory prerequisites before it is possible to use the Google Maps Android API.

Several steps need to be taken before you can use the Maps API, including:

  • Obtain a Maps API key

  • Install the Google Play Services SDK

  • Install the Xamarin.GooglePlayServices.Maps package from NuGet

  • Specify the required permissions

  • Optionally, Create an emulator with the Google APIs

For more details, you can check:

https://docs.microsoft.com/en-us/xamarin/android/platform/maps-and-location/maps/maps-api#install-gps-sdk .

and

https://github.com/xamarin/GooglePlayServicesComponents

Related