我生成了一个签名的密钥库,并使用我在MD5的注册页面中为该MD5指纹生成了一个地图api密钥来查找MD5指纹...整个过程没问题,但是当我使用该api密钥时,我没有得到地图中的位置只显示空白图块。
我在cmd提示符中使用:
C:\Program Files\Java\jdk1.6.0\bin>keytool.exe -list -alias saurabhtrivedi -keysto
"C:\Documents and Settings\Saurabh\.android\ArtPhone_keystorefinal.keystore"
torepass up78ak5831 -keypass up78ak5831
up78ak5831, Mar 24, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): *******************************
我被冻结在我的清单文件下面。
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.artphone.galleries"
android:versionCode="1"
android:versionName="0.1"
>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="@drawable/applogo" android:label="@string/app_name"
>
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".SplashScreen"
android:screenOrientation="portrait"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="currentlocmap"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="filter"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="keywordsearch"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="keywordxmlparsing"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="Artistspacedetailview"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
android:windowSoftInputMode="adjustPan"
/>
<activity android:name="loadingimage"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="keywordpagetabs"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="filterpagetabs"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
android:windowSoftInputMode="adjustPan"
/>
<activity android:name="artistspacedetailviewTab"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="filtersearchresultparsing"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="keywordresulttab"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="filterpageresulttab"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
android:windowSoftInputMode="adjustPan"
/>
<activity android:name="artspacedetailShowingNow"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="detailviewshowingnowTab"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="LatLongparsing"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation" />
<activity android:name="MyMap"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation" />
<activity android:name="MainMenu"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation" />
<activity android:name="spaceinfo"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="OpeningToday"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="Map"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="Maptab"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="Loadingimagetab"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"/>
</application>
<supports-screens
android:anyDensity = "true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
/>
</manifest>
答案 0 :(得分:0)
您应该在地图的活动布局中的com.google.android.maps.MapView
对象中插入您的Google地图api密钥。
例如:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="your_api_key"
android:clickable="true" >
</com.google.android.maps.MapView>
</LinearLayout>
以下是完整的分步教程:http://developer.android.com/resources/tutorials/views/hello-mapview.html