Using google maps on Android Studio

Pamela Chemutai
3 min readSep 20, 2021

Photo by Sergi Kabrera on Unsplash

Various apps require the use of maps in order to show the location in relation to other places in the globe, what a better way to do than to use google maps.

In this article I’m going to take you through the steps you can take to create a project using google maps.

Step 1: Create a google maps project

  1. Start by creating a new project on android studio and select the google maps activity.
https://github.com/Chemutaiselim

2. Configure your project by giving it a name;

https://github.com/Chemutaiselim

Step 2: Get an API Key for the project

After successfully creating the project a resource file, google_maps_api.xml, will automatically open if not, you can find it under resources, values (res/values).

This file contains directions on how to obtain the the API you'll use in the project.

1. In your project click to open the link I’ve highlighted /copy the link and paste it on your browser. It will lead you to the google cloud platform;

https://github.com/Chemutaiselim

2. Select create a project and click on continue. The google cloud platform will enable the API.

https://github.com/Chemutaiselim

3. Then click on the “Create API key” to get your API for the project.

https://github.com/Chemutaiselim

4. After that it will show you your API key which you can copy and use in your project.

https://github.com/Chemutaiselim

Step 3: Use the API key in your project

In the res/values/google_maps_api.xml you can paste the key , replacing “YOUR_KEY_HERE”.

https://github.com/Chemutaiselim

Now we are all done, you can run the project to view your map whose coordinates automatically point to Sydney, Australia. It will look something like this;

https://twitter.com/selim_chemutai

Conclusion

Have fun and stay tuned, more articles coming up on how to manipulate your map’s makers and generally modifying the app.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Pamela Chemutai
Pamela Chemutai

No responses yet

Write a response