android development, implementing google maps - android

straight from http://code.google.com/android/add-ons/google-apis/mapkey.html it says:
To register for a Maps API Key, you need to provide an MD5 fingerprint of the certificate that you will use to sign your application. Before you visit the registration page, use Keytool to generate the fingerprint of the appropriate certificate.
First, determine which key you will use to sign your application at release and make sure of the path to the keystore that contains it.
Next, run Keytool with the -list option, against the target keystore and key alias. The table below lists the options you should use.
I dont understand the directions to do this. I tried on the terminal using:
keytool -genkey -v -keystore microjobs.keystore -alias mjkey -keyalg RSA
and entered name, and city state then:
keytool -list
but it returns:
keytool error: java.lang.Exception: Keystore file exists, but is empty:
What should i do?
Thanks.

Might be an access problem to the folder ?
Also, later in the page you reference in your question, if you look here, Eclipse can help you generate and locate your API key.

Navigate to the folder containing the keystore file, and then run
keytool -list -alias your_alias -keystore your_file_name
where your_file_name is just the file name, without path.

Related

Cannot see google maps on android when I upload it for release (works in debug), trying to get SHA1 from my created keystore

(Mac)
I created a keystore with alias and password with the same name (projectOne) and when I try to get the SHA1 from that created keystore and put it on my created google console maps I have trouble getting the SHA1 out.
I type this in the terminal but it does not let me access the keystore.
keytool -list -v -keystore ~/.android/ projectOne.keystore -alias projectOne
It says this (roughly translated):
Invalid option/Unauthorized: projectOne.keystore
Now I use the SHA for debug:
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
And this does not work when I try to "release" it. So I assume I have to get the SHA1 from my own created keystore but as I mentioned above. It says it is an invalid option/Unauthorized option.
Based from this documentation you need to first find the .keystore file that your .apk was signed with. The keystore used will depend on if your app's .apk package was created as a debug build, or if it was packaged with a different .keystore file.
For builds that you have signed with your projectOne.keystore file, you need to substitute your own values for the .keystore file, keystore password, and alias name from when you created the keystore file.
You can follow these tutorial and forum which suggested to verify that the alias or password you use is correct.

Letting Another to Sign an APK with My Private-Key - How?

To enable another developer to sign an APK with one of my private-keys, should I give out the original KeyStore file, or would giving him only this specific key's password be enough?
Please note that my question intentionally disregards the "security" aspects of giving out a private signing key. This is not part of the question.
Thanks much.
You need to provide the other developer with the following:
The Keystore file
The password to the keystore
The name of the alias used to sign the app
The password to that alias.
If you wish, you can export the certificate for a single alias to a different keystore using the following commands:
keytool -export -alias myAlias -file mycert.cer -keystore existingKeystore.jks
keytool -importcert -file mycert.cer -keystore newKeystore.jks -alias myAlias
This is useful if you have multiple certificates in a single keystore and you only want to export a single certificate.

Java Android Google Map API sign up . MD5 certificate fingerprint and not SHA1

No map shows up but a grid. So I looked up some sample fixes and came to this
help needed to publish android app in market
however, after running the cmds as suggested, I end up with a SHA1 certificate fingerprint. But when I go to sign up for a google API key, I see I need an MD5 certificate fingerprint instead. How do I tackle this please?
And here is the solution to your problem
Open Command Prompt and navigate to C:\Program Files\Java\jre6\bin(might be different in your case).
As you are following this solution that means you have keystore with you.If yes move to step 3. else create a new keystore like mentioned in this.
Type the following command keytool.exe -v -list -keystore " <path_of_keystore_youhave_created_in_step_2>" it will ask for password use the same password you have used while creating keystore and you will get SHA1 MD5 and many information you have provided while creating keystore.
First find the location of debug.keystore (In eclipse you can find location of debug.keystore at Window->Preference->Android->Build).Then navigate the path of keytool.exe in command prompt. keytool.exe is located inside Java –> JDK – > bin folder inside program files.
For window write the following code in command prompt C:\Program Files\Java\jdk1.6.0_25\bin> keytool -list –alias androiddebugkey -keystore <path_of_debug.keystore> -storepass android -keypass android
Here <path_of_debug.keystore> is path of debug.keystore. For my case it is C:\Users\virus.android.
Copy the MD5 key(eg:- BE:05:C8:F2:42:7A:97:37:78:EE:BD:4A:31:7D:A6:69) and goto on following link to find google map api key http://code.google.com/android/maps-api-signup.html

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

Trouble generating MD5 fingerprint with new keystore

I'm trying to generate the MD5 Fingerprint I will use with the release of my application. I used Eclipse to Compile and Sign my application, which gave me a keystore file and a .apk file. Now i need to generate the MD5 for my MapViews. I tried using the cmd prompt to generate it, but everytime it states that no such file exists. Is there somewhere special i need to be storing the keystore so the keytool has access to it? Also, once i get the MD5 fingerprint, all i have to do is insert it and re-compile and sign my application (the same way i previously did it). Am i correct on that assumption? I've read through the developer docs and I'm still unclear on the whole process. Any help would be awesome.
You have a default debug keystore automatically. For release, you need to generate your own private keystore first with something like:
keytool -genkey -v -keystore my-release-key.keystore -alias release_alias -keyalg RSA -keysize 2048 -validity 10000
Once you've chosen and entered all the passwords (make a note of them!) you've generated a new MD5 (different from the debug one)
To view it:
keytool -list -alias release_alias -keystore c:\YOUR PATH TO IT\my-release-key.keystore
gives:
release_alias, 08-Sep-2010, PrivateKeyEntry,
Certificate fingerprint (MD5): CE:xx:xx:xx etc....
If you use Google maps then you need a new API key for this. Repeat the process you did to generate the one for the debug MD5 but enter the new MD5
Hope this helps.

Categories

Resources