Getting the MD5-Hash for a MapAPI-Key from the Debug-Keystor

Tutorials that use the MapActivity. Many using GPS functionality.

Getting the MD5-Hash for a MapAPI-Key from the Debug-Keystor

Postby plusminus » Sun Oct 26, 2008 8:50 pm

Getting the MD5-Hash for a MapAPI-Key from the Debug-Keystore


Works on Windows Vista, but easily adaptable to other OS.

Red is what needs to be typed, Green is the MD5-Hash you need for creating a MapsAPI-Key you can use during debugging:
Commandline wrote:[font=Courier New]C:>D:ProgrammedevJavajdk1.6.0_07binkeytool -list -alias androiddebugkey -keystore C:UsersplusminusAppDataLocalAndroiddebug.keystore -storepass android -keypass android
androiddebugkey, 13.10.2008, PrivateKeyEntry,
Zertifikatsfingerabdruck (MD5): E1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BC[/font]


Pass this key to the :arrow: APIKey-Request form.

Thats it :)
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

this is not workin

Postby saisri2k2 » Wed Oct 29, 2008 8:00 pm

Hey when i tried this. i'm getting te following message. What should i do to get the map api key?


keytool usage:

Code: Select all
-certreq     [-v] [-protected]
             [-alias <alias>] [-sigalg <sigalg>]
             [-file <csr_file>] [-keypass <keypass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-delete      [-v] [-protected] -alias <alias>
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-export      [-v] [-rfc] [-protected]
             [-alias <alias>] [-file <cert_file>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-genkey      [-v] [-protected]
             [-alias <alias>]
             [-keyalg <keyalg>] [-keysize <keysize>]
             [-sigalg <sigalg>] [-dname <dname>]
             [-validity <valDays>] [-keypass <keypass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-help

-identitydb  [-v] [-protected]
             [-file <idb_file>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-import      [-v] [-noprompt] [-trustcacerts] [-protected]
             [-alias <alias>]
             [-file <cert_file>] [-keypass <keypass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-keyclone    [-v] [-protected]
             [-alias <alias>] -dest <dest_alias>
             [-keypass <keypass>] [-new <new_keypass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-keypasswd   [-v] [-alias <alias>]
             [-keypass <old_keypass>] [-new <new_keypass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-list        [-v | -rfc] [-protected]
             [-alias <alias>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-printcert   [-v] [-file <cert_file>]

-selfcert    [-v] [-protected]
             [-alias <alias>]
             [-dname <dname>] [-validity <valDays>]
             [-keypass <keypass>] [-sigalg <sigalg>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...

-storepasswd [-v] [-new <new_storepass>]
             [-keystore <keystore>] [-storepass <storepass>]
             [-storetype <storetype>] [-providerName <name>]
             [-providerClass <provider_class_name> [-providerArg <arg>]] ...
Sai
saisri2k2
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 29, 2008 7:57 pm
Location: Houston

Postby plusminus » Wed Oct 29, 2008 8:45 pm

Hi saisri2k2,

what exactly did you enter :?:
Did you adapt the paths :?:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby saisri2k2 » Wed Oct 29, 2008 8:52 pm

C:\>C:\java\bin\keytool -list -alias androiddebugkey -keystore
C:\Users\pabbathi sai s\AppData\Local\Android\debug.keystore -storepass android -keypass android

keytool usage:

-certreq [-v] [-protected]
[-alias <alias>] [-sigalg <sigalg>]
[-file <csr_file>] [-keypass <keypass>]
[-keystore <keystore>] [-storepass <storepass>]
Sai
saisri2k2
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 29, 2008 7:57 pm
Location: Houston

Postby saisri2k2 » Wed Oct 29, 2008 8:55 pm

Yeah... i did adapt the paths.....
Sai
saisri2k2
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 29, 2008 7:57 pm
Location: Houston

Postby saisri2k2 » Wed Oct 29, 2008 11:10 pm

C:\>"C:\Program Files\Java\jre1.5.0_14\bin\keytool.exe" -list -alias androiddebu
gkey -keystore "C:\Users\pabbathi sai s\AppData\Local\Android\debug.keystore" -
storepass android -keypass android


The above command is workin... there wre spaces in the address...

Thank you very much plusminus..
Sai
saisri2k2
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 29, 2008 7:57 pm
Location: Houston

Top

Postby mschot » Wed Oct 29, 2008 11:15 pm

here how i got my fingerprint on mac OS X 10.4

Code: Select all
cd /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands
./keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android

change ~/.android/ to the path of your debug.keystore
mschot
Freshman
Freshman
 
Posts: 3
Joined: Wed Oct 29, 2008 9:47 pm

Postby nithin.warier » Sun Nov 30, 2008 6:57 am

Hi all,

I am trying to get map api key from past two days, not getting showing keytool runtime error... can anybody tell what can be the problem..

the code i tried is

C:Program FilesJavajdk1.6.0_07>keytool -list -alias androiddebugkey -keystore
C:Documents and SettingsNithinLocal SettingsApplication DataAndroiddebug.
keystore -storepass android -keypass android
'keytool' is not recognized as an internal or external command,
operable program or batch file.

getting the error like this..

I am using windows XP...

is there any problem in my keytool ??

any ideas please...

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby saisri2k2 » Sun Nov 30, 2008 7:54 am

hey brother.. the keytool is available in the bin directory of the java.... you should change the directory

the following should work for u... include even the inverted quotes.... remove spaces using the notepad etc., and paste it in the cmd prompt... good luck :)

"C:Program FilesJavajdk1.6.0_07binkeytool.exe -list -alias androiddebu
gkey -keystore "C:Documents and SettingsNithinLocal SettingsApplication DataAndroiddebug.keystore" - storepass android -keypass android
Sai
saisri2k2
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Oct 29, 2008 7:57 pm
Location: Houston

Postby Draffodx » Mon Dec 01, 2008 11:28 am

Code: Select all
C:Documents and SettingsDonal>"C:Program FilesJavajre1.6.0_05binkeytool"
-list -alias androiddebugkey -keystore "C:Documents and SettingsDonalLocal Se
ttingsApplication DataAndroiddebug.keystore" -keystore android -keypass andro
id
keytool error: java.lang.Exception: Keystore file does not exist: android



I'm having trouble getting mine, can anyone help?
Draffodx
Master Developer
Master Developer
 
Posts: 205
Joined: Wed Nov 12, 2008 2:31 pm

Postby nithin.warier » Mon Dec 01, 2008 8:19 pm

Hi sai,

i tried, now getting the error like this,

the code i tried is

C:>"C:Program FilesJavajdk1.6.0_07binkeytool.exe -list -alias androiddebug
key-keystore"C:Documents and SettingsNithinLocal SettingsApplication DataAn
droiddebug.keystore"-storepass android -keypass android

The filename, directory name, or volume label syntax is incorrect.

any idea please..

Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby nithin.warier » Mon Dec 01, 2008 8:26 pm

Hi



Got it at last, one double quote is missing in my previous query..

Thanks for your reply..

Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby zmeda » Sun Dec 28, 2008 7:09 pm

Can one1 PLEASE post working code of GoogleMaps within Android.

I can not find where is problem inside my code.

When i run my Android App I can't see Map. The only thing that i can see is white-blank screen with Google sign on bottom-left corner of the screen. Any ideas?!
Please help
zmeda
Freshman
Freshman
 
Posts: 4
Joined: Fri Nov 21, 2008 9:54 am

Postby nithin.warier » Sun Dec 28, 2008 7:43 pm

Hi zmeda,

public class MapAct extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}

@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}

xml
-----
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0QTYhfJNb0lyJNV8IZjGlOtg_5BPB"
/>

and in manifest , give these permissions--------

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />


I hope this will help..

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Step by step tutorial for getting map on android emulator

Postby Pushpalata » Sat Oct 03, 2009 7:19 am

Hello plusminus,
I hv tried a lot to get a map on my android emulator through my application......bt still not getting it....
In my application I want to access map manually. On emulator i got the GMAP bt i want the same map on button click event....I hv done the necessary thing e.g. getting the MD5 fingerprint..,and MAP API key etc. bt still it dint work.....

Whatever i done is as follows :


G:PSPSandroid-sdk-windows-1.5_r3android-sdk-windows-1.5_r3tools>keytool -genkey -v -keystore debug.keystore
Enter keystore password:
What is your first and last name?
[Unknown]: pushpalata
What is the name of your organizational unit?
[Unknown]: sneha
What is the name of your organization?
[Unknown]: android
What is the name of your City or Locality?
[Unknown]: Nasik
What is the name of your State or Province?
[Unknown]: MH
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=pushpalata, OU=sneha, O=android, L=Nasik, ST=MH, C=IN correct?
[no]: yes

Generating 1,024 bit DSA key pair and self-signed certificate (SHA1withDSA) with
a validity of 90 days
for: CN=pushpalata, OU=sneha, O=android, L=Nasik, ST=MH, C=IN
Enter key password for <mykey>
(RETURN if same as keystore password):
Re-enter new password:
[Storing debug.keystore]


after this i placed this MAP API key in main.xml file of my apllication for mapview.
but still i dint get any results........

plz reply and tell me the solution for this....
PUSHPALATA
Pushpalata
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 23, 2009 5:12 pm

Top
Next

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest