It's my first time that i use Google API. I use it with my Android App by using the beta google java api client. To test my app in the emulator, i took an API Key access from my google account and all work well. But now, what is the procedure about this API Key access if i want share my app in Google Play ? Do I leave my same Key access in the code or in the app, do i must ask final user to register with his own key acces with his google account ? Thank you for answer.
This is simple steps that u need to follow instead of registering it in the site just register the key in Google play .Here is the link example to follow up also follow up with this SO chat u might get some idea click
You should go this path in terminal (cd Library/Android/sdk/platform-tools/) Mac os, after that you can run command below
Create Debug key
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Create Release Key
keytool -list -v -keystore /Users/macbook16/Documents/AndroidProjects/natural-therapy-android/app/keystore.jks -alias myaliassample
Note : /Users/macbook16/Documents/AndroidProjects/natural-therapy-android/app/keystore.jks this path is my project .jks file path, therefore you should replace your project jks file path, And myaliassample is exampl alias, you should replace the command like of your alias
Related
i have an android application created with some apis such as push notifications, google maps, sms retriever, and some other apis.
when i build the signed apk and i copie it to my phone and i install it directly, everything is fine, the otp sms is automatically detected, the maps is shown and i have no problem.
but when i publish the same file in the store, and i download and install the app, the sms is not automatically detected, and the maps cannot be shown.
i dont know why this can happen, it is the same signed file, why everything is fine when i install it directly and i have these problems when i download it from the store?
normally these problems occur when i use a debug sha1 in production, but no i use a production sha1 which is also the same in the console .. and like i said, the application is signed.
any help please?
Using Play App Signing
If you've published your app using Play App Signing, a requirement when using Android App Bundle, you can get your SHA-1 from the Google Play Console on the Release > Setup > App Integrity page.
Also try this below way may help you
Please Try to get the SHA1 from release keystore using the command prompt and then update this SHA1 to Google map cloud console with package name where you have added debug SHA1
keytool -list -v -keystore keystore_name -alias alias_name
Like on command prompt try this way according to you folder and keytool folder
In Windows
c:\bin> keytool -list -v -keystore D:\Users\project\keystore.jks -alias test1234
In Ubuntu
keytool -list -v -keystore /home/administrator/keystorepath/keystore.jks -alias testalias
Enter keystore password: 123
I'm following this tutorial to create a Turn Based Multiplayer game: https://developers.google.com/games/services/console/enabling
Under the Specify client ID settings section, they say to run:
keytool -list -keystore [path-to-debug-keystore]
That's fine because they also mention the location of the debug keystore: "On Windows, the debug keystore can be found at C:\Users[USERNAME].android\debug.keystore."
They also say to run this command:
keytool -list -keystore [path-to-production-keystore]
But they don't mention where the release/production keystore is.
...where is it?
You generate the production key yourself. Read Sign Your App in the android developer documentation.
I would like to get a fingerprint from my android device ?
I have done a research it gave me following command :
C:>keytool -list -alias androiddebugkey -keystore C:\Users\abc_username.android\debug
.keystore -storepass android -keypass android
I would not think the above command is my answer ? what does about command do ?
see this link, it explains obtaining Maps API key through MD5 fingerprint with debug .keystore of Android:
http://eagle.phys.utk.edu/guidry/android/apiKey.html
Please go through this
With the following command you dont generate Fingerprint (MD5 Fingerprint more specifically)
for you android device. You generate MD5 Fingerprint against keystore (C:\Users\abc_username.android\debug .keystore in your case) you are using for android development.
C:>keytool -list -alias androiddebugkey -keystore C:\Users\abc_username.android\debug .keystore -storepass android -keypass android
In Android this Fingerprint is useful to get Google Map api key which we can use in MapView.
If you change keystore, you will have to regenerate this fingerprint regarding to new keystore for getting api key from Google for MapView
About keytool
keytool is a key and certificate management utility. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures. It also allows users to cache the public keys (in the form of certificates) of their communicating peers.
Hope this will help you
I want to use googleAPI. I have tried the following:
1)I have generated a googleAPI key using the keytool and the debug.keystore.
2) I have also generated another key using Myactivity.keystore.
Following these instructions, from fere and other sits:
You'll have to do following things to get it working:
You'll have to generate a MD5 hash of your application debug key
You'll have to provide that MD5 hash to Google while signing up for a map key
Google will then give you a key that you can put in your mapview
This is going to work in these steps:
Locate the android debug key in your system. it is found on the following locations depending on your operating system (This path will be useful):
Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore
Mac OS X and Linux : ~/.android/debug.keystore (where ~ is the path of your home directory.
In a terminal, use the following keytool command to generate the MD5 Hash:
keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore -storepass android -keypass android
Copy the generated hash
Go to : code.google. com/android/maps-api-signup.html (you maybe required to login with your Google account)
Paste the above generated MD5 hash there, accept the Terms and Conditions and click on Generate button
You'll get the API key for your map. paste this in your
When you plan to release the app, generate a release key and repeat the same procedure with the release keys.
Although, all the above steps are exactly what the links contain, but this is a summary.
I have tried them both but non of them seems to work. I see only the grid ant in the logcat i get Couldn't get connection factory client and through all the search I have done this is a problem with my api key. how should I know that my api key is correct?
Try This to get Correct API key:--
That is the exact path--
keytool -list -keystore "C:\Users\XYZ\.android\debug.keystore"
Total path for cmd prompt to get the MD5 fingureprint for the GoogleMap API Key***
D:\eclipse\jre\bin>keytool -list -keystore "C:\Users\XYZ\.android\debug.keystore"
MD5 fingurePrint will look like this--
3E:F4:D6:E6:93:4D:BB:B8:62:3A:A6:0F:E0:FC:4C:65
When u get the fingurePrint number afterthat to get the API Key use this link---
http://code.google.com/android/add-ons/google-apis/maps-api-signup.html
Then u will get API key of your system and can get the Map easily....
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..