How implement Google Maps APIs in android

Updated 22 December 2016

Save

In this blog,
I have shown you how to add the google map in your application step by step.

Android allows us to integrate google maps in our application to show any shop, routes, restaurants, location etc. on the map.

Google made new Maps V2 API as a part of Google Play Services SDK.

 

How to implement the map in your application

Step 1: Add the play service library into your project build.gradle

Step 2: After adding the library you can use Google Map – Layout file where you want to display the map

Step 3: Add some permissions with the Google Map API key in the AndroidManifest.XML file

 

Step 4: Get the Api key from here.

Screenshot_1

 

For generating the API key you have to create a new project or select the existing one

Screenshot_2

After selecting the project you have to select Android on the add credentials to your project section

Screenshot_4

After fill the all the requirments you get the API key from google.

You can also you the existing API key.

Step 5: Initilize the Map

 

Step 6: Adding Markers

You can create markers on the map via the Marker class.

Step 7: Zoom Camera

This is method newLatLngZoom(LatLng latLng, float zoom).
Step 8: If You want then can animate the map

 

How to add multiple markers

In this example, I have taken three country codes and display it on google map

 

 

 

 

 

 

author
. . .

Leave a Comment

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


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home