Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google map can be displayed on emulator but not in Android Device

I already get the Google map API key to run on the emulator, but when I run the program on real android device, the Map doesn't show up. I've read some of the solution that said that I have to get the release key from Google, but the solution doesn't tell me HOW can I get those key

like image 627
JOY Avatar asked Mar 08 '11 11:03

JOY


2 Answers

It is not only about the Android app keystore or the Android Maps API Key. It is a combination of both. We need the keystore when we want to sign a App.

The way you can sign a App is as follow; (I am giving instructions by assuming that you are working with Eclipse IDE)

  • Right click on your project in the Package Explorer window
  • Android Tools -> Export signed application package
  • In Project Checks window, brows your project and go to next window
  • There, select "Create new keystore" and follow the wizard
  • Don't give the default password which comes with the Eclipse debug key

Then you can finish creating a signed key for your app. Next procedure is Android Maps API Key Signup process. Here I am assume that you are doing implementation in a Windows environment

  • Open command prompt
  • Go to the place where you have saved your keystore file in previous process
  • Give the command "keytool -list -keystore keystore.filename" with out quotes
  • They will ask "keystore password", provide the same password given in creating the keystore
  • Then you can get a MD5 key
  • Copy it and go this link

Give the MD5 key on the appropriate place, provide the tick. Then the Google people will provide you a XML code. You have to insert that code in the XML file where you need to load the map.

Bingo... now you have created an App which support Google map API that runs on a emulator as well as real device. :-)

like image 83
AnujAroshA Avatar answered Oct 11 '22 13:10

AnujAroshA


Generate a new key-store , get a Api key again and use the new key.

like image 41
Ravi Vyas Avatar answered Oct 11 '22 13:10

Ravi Vyas