Difficulty in Obtaining an API key for Google Maps - android

I am following the instructions in this tutorial https://web.stanford.edu/class/cs193a/lectures/maps.pdf
I get the command prompt to C:\Users\USERNAME.android (for windows new)
I then type >keytool -list -v -keystore debug.keystore
but when I press Enter I get:
What is going wrong? It seems like I have not set something up quite correctly, because I have followed the instructions which didnt seem difficult.

1. Open Terminal In Android Studio you are running.
2. Enter: keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
3. Copy SHA1 key.
4. Go To Google developer console and select Android API Key.
5. Copy SHA1 key to android Fingerprint and Write Package in Package Name block.
6. Generate API key.
7. USE API key

Related

Google Maps Api don't work when uploaded

My application does not work when I upload it to the play store. It works fine when installing it from android studio.
Is there something special that's need to be done with the api key?
In windows this would be the command to get SHA1 key
Open a terminal window.
​
cd C:\Program Files\Java\jdk1.7.0_05\bin
Next we have to run the keytool.exe. Use the following line to get the Android SHA1 fingerprint.
​(PRODUCTION KEYSTORE) keytool -exportcert -alias keystore -keystore "C:\Users\myusername\Documents\AndroidKeystore\androidkestore.jks" -list -v​
​(DEBUG KEYSTORE:)​
keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android​
Note the third point where keystore for production is retrieved. You need to add this value into your developer console as shown below
Go to your Google Api Console -->> Select your Project --> Go to Credential --> Click on Api key you generated.
Here you can check the packageName And your SHA 1 check if eveythign is proper.(you have submitted correct SHA1)
And It should work.

How to create release key for android v2 maps

I tried below code for a debug key and its working fine. When i make a apk then map is crashing. After searching in google i found debug key is work in release mode.
keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
So,how can i create a release key for v2 maps. please help me.
I didn't had the chance of doing that, but for my understanding what should be done is:
1. First of all you will need to export you project as a Signed Application:
Right click your project -> Android Tools -> Export Signed Application Package...
This will take you through wizard where you would have to create a new release.keystore with a password or use an existing one you created before.
2. From this point on the process should be identical to the one where you use the debug.keystore.
3. All the steps of creating a debug api key and registering it in Google API Console are described at this blog post I wrote:
Google Maps API V2 Key
4. Just remember that using the debug.keystore will not give you desired result.
Tyr this..
your directory where you have installed java and go to the bin folder.
For example-
C:\Program Files\Java\jdk_your_version\bin>keytool -list -v -keystore C:\Users\your_user_name\.a
ndroid\debug.keystore -storepass android -keypass android
i think it might help you.
C:\Program Files\Java\jdk_your_version\bin>keytool.exe -list -v -alias androiddebugkey -keystore C:\Users\your_user_name\.android\(Application).keystore -storepass YOUR_STORE_PASSWORD -keypass KEY_PASSWORD
Generally YOUR_STORE_PASSWORD and KEY_PASSWORD are same is "android".

Android apikey Not Supported for Google Map

I got a fingerprint
73:F9:85:F8:14:56:4A:E7:D1:D4:31:6F:23:AA:4D:38:EB:16:5C:EE
but when i used to generate api Key using this link
http://code.google.com/android/maps-api-signup.html it shows
"The fingerprint you entered is not valid. Please press the Back
button on your browser and enter a valid certificate fingerprint".
If i omit last four Character and use
73:F9:85:F8:14:56:4A:E7:D1:D4:31:6F:23:AA:4D:38
it generate api key that not support to create Google map in android Application
Set Your java Path in Command Prompt And also set debug.keystore path.
C:\Program Files\Java\jdk1.7.0_02\bin >
keytool -v -list -alias androiddebugkey -keystore "C:\Users\UserName\.android\debug.keystore" -storepass android -keypass android
And use MD5 fingerprint .....
Super easy with Eclipse Keytool addon-tool
You can use the android.debug key for debugging or your own key for using it on a device.

Obtaining Google Maps API key

I'm using Windows 7.
I have tried several times with the debug.keystore with appears in c:\users\YOURUSER.android\ using the command:
keytool -list -alias androiddebugkey -keystore c:\Users\YOURUSER\.android\debug.keystore -storepass android -keypass android
It gives me a MD5, but then I go to Google MD5 registration page and it sais it is not a valid fingerprint.
I searched for more information, and I finally created a new debug.keystore into c:\users\YOURUSER\ to avoid rewriting the original one. I used this command:
keytool -genkey -keypass android -keystore c:\users\YOURUSER\debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
It works, so I use the previous command to get the MD5, and it gives me a new MD5. Then I go to Google again and the same problem: "not a valid fingerprint".
The I made a second attempt. This is what I did then:
1) Opened a Windows7 terminal, went to c:\program files\java\jdk1.7.0\bin\
2) Wrote command:
keytool -genkey -v -keystore c:\eclipse\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
3) Then I tried to get the MD5 code from my keystore, using comand:
keytool -list -alias alias_name -keystore c:\eclipse\my-release-key.keystore
and writing the password I am asked. It gives me a MD5.
4) I go to maps api key sign up and write the MD5. "FINGERPRINT NOT VALID"
I don't know what the problem is. And I am supposed to do this for every app I program? What a headache!
Can anybody help me please?
Are you sure you get the MD5 and not the SHA1 fingerprint? Tryed the -v option?
see: How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2.
previously we generated md5 key but now we need to generate sha-1 fingerprint certificate.
The Maps API key is based on a short form of your application's digital certificate, known as its SHA-1 fingerprint. The fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application.
please go through the links it could help you
https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key
https://developers.google.com/maps/documentation/android/intro#sample_code
also see the same kind of post in stack over flow
How to implement Google Maps new version of API v2
In command line you need to open Java-> jdk-> bin
as for me it is "C:\Program Files\Java\jdk1.7.0_03\bin"
There is "keytool" program which u need. In command line enter "cd C:\Program Files\Java\jdk1.7.0_03\bin"
And enter "keytool -list -v -keystore C:\Users\John\.android\debug.keystore"
So the final string in command line must look like:
"C:\Program Files\Java\jdk1.7.0_03\bin>keytool -list -v -keystore C:\Users\John\.android\debug.keystore". Whare usually u need only to change the name "John"
There will be SHA-1, MD5, etc
Finally, go to Google Access API google access api

To Display the Google map on the emmulator

Now I am working on the Google maps API. I am not able to display the map on the emulator as well as the device......... how can i dis play the map.
I tried like this but i failed...
I searched for the debug.keystore in c:/ i found it.
I got Keytool.exe from the "C:\Program Files\Java\<JDK_version_number>\bin".
Opened the commend prompt and went to the above folder.
After that i copied this
"keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android"
and pressed enter then I got the Google api key **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
I pasted the key in this site http://code.google.com/android/maps-api-signup.html.
but the map is not generated it is saying that
fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint.
What i need to do now to get the Map API key.
Okay, I was able to solve the problem in my case. I've got Java 7 on my machine and when I followed all the instructions as they are, I've got a SHA1 fingerprint, not MD5. I tried to use it to get the key and received exactly the error message from which this thread has started.
If you are having the same problem, just add the -v option (verbose output) after -list. keytool will then give you the MD5 fingerprint as well - use it.
keytool -list -v -alias androiddebugkey -keystore C:\Users\<user>\.android\debug.keystore -storepass android -keypass android
I will try to let Android folks know that they need to update the page with instructions.
for JDK 1.7 you get SHA1 fingerprint by default. But for generating Google Map API key you need fingerprint of MD5.
For more details navigate through the below link.
How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
Ok, so what you're supposed to enter in the link you posted is the MD5 fingerprint of your android SDK debug certificate. To get this you navigate here
Windows Vista: C:\Users\.android\debug.keystore
Windows XP: C:\Documents and Settings\.android\debug.keystore
and then enter
keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android
What you're currently doing is navigating to your Java folder and trying to find the fingerprint for your android SDK debug certificate there. It isn't located in that folder and hence you end up with a blank fingerprint ::*:::*:::*:::*:::*:*
You need to find the .android folder.
have you checked the path you use? I mean "C:\android\debug.keystore", Does the file there?
have you compared your fingerprint (the result of keytool.exe calling) with the example on http://code.google.com/android/maps-api-signup.html page? they must be very similar, maybe you just copied not the whole fingerprint from the cmd
Here is the simplest way to generate MD5 signature.
Find the folder .android which contains debug,keystore(usually it is located in c:\Documents and Settings\"User Name".android
Oepn command prompt and go to the keytool folder that you mentioned.
Now use following easy command to key MD5 fingerprint.
keytool -list -keystore "c:\Documents and Settings\"User Name".android\debug.keystore"
press Enter. It will ask you for password again press enter.
Enter the generated key in Google API registration page.
Use this key in your MapView.
I too had the same problem but got fixed...the problem might be you.. might have not given default location for emulator..i will get u the proper way to get the map in emulator...
1)to generate the hash key
http://code.google.com/android/add-ons/google-apis/mapkey.html
2)to set the default location
http://www.vogella.de/articles/AndroidLocationAPI/article.html#device_installation
hope it works fine..

Categories

Resources