Share Coding

Tutorials, Problems, Stuffs …

Android MapView – Maps API Key

<com.google.android.maps.MapView
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:apiKey="09dDIQhcuPhn1nBq24u6W2Vnr2IxTGJgG8Zdo2g"
/>

—————————————————————————————————————————-

1. find debug.keystore file.

C:\Documents and Setting\User\Local Settings\Application Data\android\debug.keystore
OR
C:\Documents and Settings\User\.android\debug.keystore

—————————————————————————————————————————-

2. using keytool

CMD > C:\Documents and Settings\User\.android\

For JDK7+: keytool -list -keystore debug.keystore -v
For JDK 6: keytool -list -keystore debug.keystore

password(if needed): android

if an error received: keystore is not recognized as an internal or external command, you need to set environment variable: add to path: …..; C:\Program Files (x86)\Java\jre7\bin; (which contains a keytool.exe)

—————————————————————————————————————————-

3. obtain information from debug.keystore

MD5: EA:5E:37:80:F1:48:D6:AB:24:C1:9B:4E:A9:5B:4C:B5
SHA1:...
SHA256...

—————————————————————————————————————————-

4. Sign Up for Key
Go to: https://developers.google.com/android/maps-api-signup?hl=zh-TW, parse the certificate fingerprint (MD5 from above step), agree and submit
—————————————————————————————————————————-

5. Replace
The key from Google is something like:

09dDIQhcuPhn1nBq24u6W2Vnr2IxTGJgG8Zdo2g

finally, replace the value of apikey of mapview in xml

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: