Create Xamarin Android Google Map With Add Markers

Let’s start

Before we create a Google Map application we need  Signed Fingerprint SHA1 KEY. So, I already explained how to create SHA1 KEY.

Step 1:Open Visual Studio->New Project->Templates->Visual C#->Android, then click Blank App, and select Blank App. Then give Project Name and Project Location.


 Step 2:Next Click to select Solution Explorer->Project Name->Properties-> AndroidManifest.xml file.
Step 3: Here will be Copy and paste of the already created Google Map SHA1 KEY and also it will give some permissions.


XML Code:

<?xml version="1.0" encoding="utf-8"?> 
 <manifest xmlns:android="" package="com.googlemap.googlemap" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> 
 <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" /> 
 <application android:label="googlemap"> 
 <meta-data android:name="" android:value="YOUR_API KEY" /> 
 <meta-data android:name="" android:value="@integer/google_play_services_version" /> 
 <user-permission android:name="com.googlemap.googlemap.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> 
 <uses-permission android:name="com.googlemap.googlemap.permission.MAPS_RECEIVE" /> 
 <uses-permission android:name="" /> 
 <uses-permission android:name="android.permission.INTERNET" /> 
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
Step 4: Next we add Google Map References to click Solution Explorer-> Project Name->Components.


Step 5:Then Add packages Google Play services – Maps, then check Solution Explorer-Project Name->References to be added Google play services packages.


Step 6: Next create Map function. In select Solution Explorer->Project Name->Resources->Layout->Main.axml, Click and open AXML Design Page to added below Code.





 <?xml version="1.0" encoding="utf-8"?> 
 <LinearLayout xmlns:android="" 
 class="" /> 

Step 7: Next open MainActivity.cs page, then Add Namespace and following code.



Namespace: using Android.Gms.Maps;

C# Code:

public class MainActivity: Activity, IOnMapReadyCallback 
 private GoogleMap GMap; 
 protected override void OnCreate(Bundle bundle) 
 private void SetUpMap() { 
 if (GMap == null) { 
 FragmentManager.FindFragmentById < MapFragment > (Resource.Id.googlemap).GetMapAsync(this); 
 public void OnMapReady(GoogleMap googleMap) { 
 this.GMap = googleMap; 

Step 8: Then Debug and run the application then check emulator showing Google map,


Step 9:
Next Google map Marker will be added.

Step 10: Open MainActivity.cs page select section of OnMapReady Function to added following code.


C# Code:

LatLng latlng = new LatLng(Convert.ToDouble(13.0291), Convert.ToDouble(80.2083)); 
CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15); 
MarkerOptions options = new MarkerOptions().SetPosition(latlng).SetTitle("Chennai"); 

Step 11: Then Run the Application,

Download Source here

Finally, we have successfully created Xamarin Android Google Map with marker Application.


Leave a Comment

Your email address will not be published. Required fields are marked *