2010-01-30 51 views
3

我有一些問題在Android開發中將瓷磚加載到我的MapView中。我已經在這裏搜索並查看了類似的問題,但迄今爲止沒有運氣。Android MapView - 瓷磚沒有用調試API密鑰加載

我已經看過指令here並掌握了我的調試API密鑰。我已經進入到我的MapView中。

我檢查過我的模擬器和我的調試設備有互聯網連接。

我已將我的清單文件中的Internet許可標記移至應用程序標記之前。

我不知道還有什麼要檢查。

我也不確定開發這個最好的方法。看起來我無法使用正確簽名的應用程序進行調試,因爲調試密鑰庫需要相同的密碼 - android。這意味着每次我去發佈版本時,我都必須改變密鑰 - 這看起來非常脆弱!

是否有任何方式使用我自己生成的地圖API密鑰來開發和發佈構建版本?

一些代碼,你看看:

的main.xml:

<com.google.android.maps.MapView 
    android:id="@+id/mapView" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:apiKey="??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??" 
    /> 

的AndroidManifest.xml:

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:versionCode="1" 
android:versionName="1.0" 
package="com.my.package.name" 
> 

<uses-sdk android:minSdkVersion="3"></uses-sdk> 

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

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    android:debuggable="true" 
    > 

    <activity 
     android:name=".MyMainClass" 
     android:label="@string/app_name" 
     > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

    <uses-library android:name="com.google.android.maps" /> 

</application> 
</manifest> 

任何幫助非常讚賞。

回答

11

android:apiKey =「??:?:??:?? ?? ?? ?? ????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??? ??:?:??」

,你有冒號在那裏表明,也許你誤以爲你應該在貼什麼的事實。

冒號都在簽名密鑰的MD5指紋。然後您需要將這些東西粘貼到form on a Google Web site中,然後找回實際的簽名密鑰,其格式如下:

android:apiKey="00yHj0k7_7vzHbUFXzY2j94lYYCqW3NAIW8EEEw"