Assuming the preferences for the Eclipse development platform have not been changed from the default values, then following steps can be used.
Generate the Certificate Fingerprint
- On Windows, open up a Command Prompt.
- In the Command Prompt window, use the cd command to change to the .android subdirectory underneath your "home" directory, e.g. C:\Documents and Settings\xxxx\ where xxxx is your user name.
C:\> cd "\Documents and Settings\xxxx\.android" - Type in the following keytool command.
C:\> keytool -list -keystore debug.keystore
Note: if the system PATH is not set with the Java Development Kit's bin folder, then the full path to the keytool executable in the JDK/bin/ directory need to be used. For example,
C:\> "\Program Files\jdk1.6.0_18\bin\keytool -list -keystore debug.keystore
The following prompt is displayed.
Enter keystore password: - Type in a password, e.g. android.
The following information may be displayed.
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, Feb 2, 2010, PrivateKeyEntry,
Certificate fingerprint (MD5): 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98 - Note down the certificate fingerprint, e.g. 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98.
Generate the API key
- Click this link to http://code.google.com/intl/ja/android/maps-api-signup.html
- Type in or paste the certificate fingerprint, accept the terms and conditions and click Generate API Key.
The API key is generated. - Copy this API key and use it in any Android layout.xml file that uses the MapView control.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
<com.google.android.maps.MapView
android:id="@+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0Prelr1y0-DbJXwq7tIfLRwDLWTZb-MJA76FtYw"
/>
</LinearLayout>
No comments:
Post a Comment