Xamarin.Android application with Bing Maps

0

I saw that the Bing Map API does not provide an Android SDK. How could I create a Xamarin.Android app with Bing Maps?

    
asked by anonymous 25.06.2018 / 16:34

1 answer

3

After a quick exchange of information with Matheus (question author), I realized that there is no explicit need to use Bing Maps . So I'm going to submit two map APIs to Xamarin.Android , which in my opinion are the best and most reliable ones today.

  • Google Maps API
  • Mapbox API

Google Maps API

Using the Maps application is great, but sometimes you want to include maps directly in your application. In addition to the integrated map application, Google also offers a native mapping API for Android. The Google Maps API is suitable for cases where you want to keep more control over the mapping experiment. Things possible with the Google Maps API include:

  • Programmatically change the map view;
  • Add and customize bookmarks;
  • Marking a map with overlays.

Unlike the now disabled Google Maps API for Android v1, the Google Maps API v2 API is part of Google Play Services. Therefore, you must meet some mandatory prerequisites before you can use the Google Maps API for Android in a Xamarin.Android application.

In addition to the NuGet packages required for the Maps API, you also need to install Google Play Services .

Perhaps the trickiest part is setting up your app so that you can receive the Google Maps API. You need to create an account in the Google APIs, generate a key, and link the same with your app. But do not be scared, it's all well documented.

Required reading

Mapbox API

The Mapbox Maps SDK for Android is a set of open source tools for creating mapping applications for Android devices with great flexibility for visual style and customization.

With Mapbox Studio, you can customize all aspects of the map, from adjusting the colors to hiding or displaying specific layers, until you decide what information you want to display on the map.

Choose a map style or completely customize your own map and data. Maps are rendered at a super high frame rate - allowing maps to respond fluently to user comments or scripted events.

The Mapbox API for Xamarin.Android is as good an option as (in my opinion even better than) the Google Maps API.

I'm saying this because I needed some features that Google Maps does not offer in your Xamarin SDK, such as using an offline map with no expiration date and advanced customization of maps that the Mapbox API offers.

The only drawback I found was that the version for Xamarin.Android of the Mapbox API did not have all the methods implemented due to the fact that it was done by the Xamarin development team and they forgot to carry all the features.

By exchanging emails with the team responsible for the API (Xamarin), they informed me of the existence of another library that was ported by another company and that at first works perfectly. The link to this API / SDK is in the "required reading" section below.

Required reading

Still want to use Bing Maps?

If you still want to use Bing Maps in your application, the only modification you have to do is to change your Xamarin.Android project to a Xamarin.Forms project.

A Bing Maps API is available for Xamarin.Forms that uses the Google API together.

Required reading

Conclusion

Given the experience I've had with both APIs, I recommend using Mapbox. Besides being much more customizable than the Google Maps API, the support of the company in case of doubts and problems is very good and the API documentation is very complete.

I've been using Mapbox for two years, and the API maps are in both a Xamarin.Android application and a .NET Core application. So far I did not get any kind of problem, quite the contrary, just compliments.

Source (other than previously reported)

25.06.2018 / 18:42