I am trying to follow the Android mapping tutorial and got to this part where I had to get an API key.
I have found my debug.keystore
but there does not appear to be a keytool
application in the directory:
C:\Documents and Settings\tward\\.android>ls adb_usb.ini avd debug.keystore repositories.cfg androidtool.cfg ddms.cfg default.keyset
There is also no keytool
in this directory:
C:\Android\android-sdk-windows\tools>ls AdbWinApi.dll apkbuilder.bat etc1tool.exe mksdcard.exe AdbWinUsbApi.dll ddms.bat fastboot.exe source.properties Jet dmtracedump.exe hierarchyviewer.bat sqlite3.exe NOTICE.txt draw9patch.bat hprof-conv.exe traceview.bat adb.exe emulator.exe layoutopt.bat zipalign.exe android.bat emulator_NOTICE.txt lib
I am using Eclipse as my editor and believe that I have downloaded all the latest SDK.
What am I doing wrong?
If you look at where you installed Android Studio (usually C:\Program Files\Android\Android Studio on Windows or /Applications/Android Studio on Mac), you'll find a folder inside called jre . You'll be able to find the keytool command there.
keytool is a tool to manage (public/private) security keys and certificates and store them in a Java KeyStore file (stored_file_name. jks). It is provided with any standard JDK / JRE distributions. You can find it under the following folder %JAVA_HOME%\bin .
all you have to do is go to environment variables, click PATH to make it active, then click edit, then add complete path where your keytool is, for me i will add C:\Program Files\Java\jre7\bin this will allow you to execute keytool commands without going to the directory where keytool is installed. Save this answer.
Keytool is included as part of the Java runtime. So by installing Java, you'll also have keytool in your system. To install Java, visit the JAVA SE Downloads page. Then, select the JDK Download link.
keytool
comes with the Java SDK. You should find it in the directory that contains javac
, etc.
Okay, so this post is from six months ago, but I thought I would add some info here for people who are confused about the whole API key/MD5 fingerprint business. It took me a while to figure out, so I assume others have had trouble with it too (unless I'm just that dull).
These directions are for Windows XP, but I imagine it is similar for other versions of Windows. It appears Mac and Linux users have an easier time with this so I won't address them.
So in order to use mapviews in your Android apps, Google wants to check in with them so you can sign off on an Android Maps APIs Terms Of Service agreement. I think they don't want you to make any turn-by-turn GPS apps to compete with theirs or something. I didn't really read it. Oops.
So go to http://code.google.com/android/maps-api-signup.html and check it out. They want you to check the "I have read and agree with the terms and conditions" box and enter your certificate's MD5 fingerprint. Wtf is that, you might say. I don't know, but just do what I say and your Android app doesn't get hurt.
Go to Start>Run and type cmd to open up a command prompt. You need to navigate to the directory with the keytool.exe file, which might be in a slightly different place depending on which version JDK you have installed. Mine is in C:\Program Files\Java\jdk1.6.0_21\bin
but try browsing to the Java folder and see what version you have and change the path accordingly.
After navigating to C:\Program Files\Java\<"your JDK version here">\bin in the command prompt, type
keytool -list -keystore "C:/Documents and Settings/<"your user name here">/.android/debug.keystore"
with the quotes. Of course <"your user name here"> would be your own Windows username.
(If you are having trouble finding this path and you are using Eclipse, you can check Window>preferences>Android>Build and check out the "Default Debug keystore")
Press enter and it will prompt you for a password. Just press enter. And voila, at the bottom is your MD5 fingerprint. Type your fingerprint into the text box at the Android Maps API Signup page and hit Generate API Key.
And there's your key in all its glory, with a handy sample xml layout with your key entered for you to copy and paste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With