O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating maps

In Chapter 8, Mastering Intents – A Walkthrough, we use an intent aiming to redirect us to the google map application at a specific address. In this recipe, we will see all the options available with the Google Map and Google Street Intents.

Getting ready

Create a new project named GoogleMapsIntents.

How to do it...

  1. Drag and drop three different buttons in your application.
  2. Map the newly created three buttons on press events with the following three code examples:

    Button 1:

    var geoUriToMontreal = Android.Net.Uri.Parse ("geo: 45.5088400, -73.5878100?z=4x");
    var mapIntentToMontreal = new Intent (Intent.ActionView, geoUriToMontreal);
    StartActivity (mapIntentToMontreal);

    Button 2:

    var geoUriTotheEiffelTower = Android.Net.Uri.Parse ("geo:0,0?q=Eiffel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required