Implementing Maps In Android

If you are a developer, it is expected of you to learn new things frequently because techniques and approaches evolve often.

I know this can be pretty much difficult especially if you have an 8 to 5 job where deadlines and the likes won’t help matters.

Enough story :D.

I recently worked on an android project that required me using Maps API. I had idea of how to go about in my head (this is a common thing) but I have never really worked with too many APIs from google play services.

Most of the tutorials I found used Eclipse and I wanted it done in Android Studio (AS).

One of my many challenges was gradle (we all know this feeling). I didnt have an updated version of google play services and gradle no gree. That was solved gallantly.

I successfully had a successful implementation with the help of a colleague and I felt a sharing the knowledge wont do me any harm. Would it? ;).

Step 1:

  • Get your SHA1 certificate fingerprints by typing this (keytool -list -v -keystore “%USERPROFILE%\.android\debug.keystore” -alias androiddebugkey -storepass android -keypass android) on your command prompt. Note your SHA1 key


Step 2:



  • Enable API


  • Select Credentials from the left pane and click on CREATE NEW KEY.Then you select Android Key


  • Insert your SHA1 certificate fingerprints and package name separated by a semi-colon (e.g 45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:12:17:F2:56:26:A0:E0;com.example) and generate a new key
  • Yaayy! We have a new API key for our android app. You should have something like this.


Step 3:

  • Create a new Activity in your project and select Maps Activity (New>>Google>>Google Maps Activty)
  • At this point, AS should help you pull the needed dependencies. Any luck with gradle? If you have any challenge, mention me on twitter.
  • Replace the key in the google_maps_api.xml with the key that was generated in the console.

71 81

  • Just for a check. Confirm that your AndroidManifest.xml has the following permissions


  • Run your project and all these should  have led you to a successful journey on Maps. See my screenshot below.
  • Now all you need do is play around with Location class and fix your longitude and latitude.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s