Android Google Map Application Example

Android Google Maps Application

  • To integrate with Google maps application you need to apply for a free Google Map API Key.
  • To get the Google Map API Key you need to sign up for the Android Maps API.
  • To sign up, you will need to provide the certificate's fingerprint (MD5).
  • If you have a certificate fingerprint (MD5) you can sign up here and get the API Key.

To get certificate fingerprint (MD5) follow the simple steps below:

  • You need to get the keystore file for getting the certificate fingerprint (MD5).
  • Your keystore file can be found at the following path

"C:\Documents and Settings\<username>\Local Settings\Application Data\Android"


"C:\Documents and Settings\<username>\.android"

  • Keystore file name is "debug.keystore" file.
  • Copy the "debug.keystore" file to some other folder (ex: - "D:\Androidkeystore\") (its user friendly to use).
  • Open command Prompt and go to the Java installed directory. ("C:\Program Files\Java\<JDK_version_number>\bin")
  • Then type the below line (given in box) and press enter.

keytool.exe -list -alias androiddebugkey -keystore "D:\AndroidKeystore\debug.keystore" -storepass android -keypass android

Now you will get a certificate fingerprint (MD5). (see the below image).


Here the MD5 certificate fingerprint is "64:88:A2:FC:AA:9F:B1:B0:CA:E4:D0:24:A8:1E:77:FB"

Click here to go for sign up page to get Google Map API Key.

Enter the MD5 certificate fingerprint in the textbox and get the API Key (see below image)


After clicking the Generate API Key Button , you will get Google Map API Key (red circled).


Now the sample xml layout code to use the Google map application in Android is as specified below


To use Google map in your application, you need to add <uses-library> element together with the <uses- permission> in AndroidManifest.xml file.

Now your AndroidManifest.xml code looks like

[sourcecode language="xml"]
<?xml version="1.0? encoding="utf-8??>
<manifest xmlns:android=""
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="" />
<activity android:name=".SampleMapApplication"
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<uses-permission android:name="android.permission.INTERNET"/>

To display map in your application, modify the main.xml file. It is located in <project-folder>/res/layout.

Use <> element to display map.

Now your main.xml code looks like

[sourcecode language="css"]
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=""

Now edit your Java class file as specified below

[sourcecode language="java"]

public void onCreate(Bundle savedInstanceState)
protected boolean isRouteDisplayed() {
return false;


Now run the application, you should be able to see the Google Map...



HI sivan, When ever an

HI sivan,
When ever an application force closes.. see the Logcat in eclipse. It clearly says what caused the error and tell what exception occured with exact line number.
If you r not sure where the logcat is here we go
windows->show views->other->Android->logcat

hi kailash,

hi kailash,
The target is set to a single project on a whole.. it does not varies with tabs. It could have forced closed due to some other reasons.
check the logcat to find out the reason.

Karthikeyan, Paste your

Paste your logcat error msg here.
So that we can try to find error.