Location Manager In Android Programming

 

This is a sample application which shows the Location by using Google Map. Last blog published in this forum is Use of SQLite.
Underlying Algorithm:
Basic description of algorithm in step by step form:

1.) Create a Project LocManageDemo.
2.) Add the following permissions to your application in AndroidManifest.xml :

 

 

 

3.) Put the following code in res/layout/main.xml :

 

 

 

4.) Replace “Your Maps API Key” with your Google API key.
5.) The next step requires that you have to generate your Google Map key. Steps to generate Google Map Key :
i) Run your cmd prompt.
ii) Reach your folder where you have installed java because you have to use a tool called keytool.exe located here.

 

 

 

iii) Enter the following in cmd prompt.

 

 

 

iv) You will get a MD5 fingerprint something like the text below

 

 

v) Copy the MD5 fingerprint and put it here
http://code.google.com/android/maps-api-signup.html
vi) You will get a Google API key something like this :

 

 

 

6.) Run the application.

Steps to Create:

1.) Open Eclipse. Use the New Project Wizard and select Android Project. Give the respective project name i.e. LocManageDemo. Enter following information:

Project name: LocManageDemo
Build Target: Google APIs
Application name: LocManageDemo
Package name: com.app.LocManageDemo
Create Activity: LocManageDemo

Make sure to select the “Google API” as Target.

On Clicking Finish LocManageDemo code structure is generated with the necessary Android Packages being imported along with LocManageDemo.java. LocManageDemo class will look like following:

 

 

 

Output –The final output:

Leave a Comment:

6 comments
Prashant Kumar says July 11, 2011

Hi Sushant,
Thanks for your post.

Can I request you to elaborate the below step.
I am getting keytool error..

5.iii) Enter the following in cmd prompt.
keytool.exe -list -alias androiddebugkey -keystore C:myandroid.androiddebug.keystore -storepass android -keypass android
//the characters marked in red are subject to change according to place where your android file is located

Regards,
Prashant

Reply
Prashant Kumar says July 11, 2011

Hi Sushant,
Thanks for your post.

Can I request you to elaborate the below step.
I am getting keytool error..

5.iii) Enter the following in cmd prompt.
keytool.exe -list -alias androiddebugkey -keystore C:\myandroid\.android\debug.keystore -storepass android -keypass android
//the characters marked in red are subject to change according to place where your android file is located

Regards,
Prashant

Reply
Sushant says July 11, 2011

Hello Prashant,

You need to put correct path of your debug.keystore in place of “C:\myandroid\.android” in given example. You will find it in your “documents and settings”.

Thanks

Reply
Prashant Kumar says July 11, 2011

Thanks, I was putting only one “” instead of double”\”..

Reply
Rick says October 17, 2012

I can see only google with blue screen, anything I should change ?

Reply
Shital Rajguru says November 30, 2012

Thanks Sushant, great help

Reply
Add Your Reply