2012-09-23 97 views
0

我正在運行我創建的使用Google Maps API的應用程序。Android模擬器v/s電話

它在仿真器上按預期工作,但我使用的是圖形,但似乎以不同的方式在我的手機上渲染。

請參看下面的圖片作爲參考

on my HTC Explorer , the Bevel effect isn't visible  on my emulator , the Bevel effect is perfectly visible This is the image i'm repeating - its being used in the background of the view

這裏的原因被觀察到不同相同的圖像我activity.xml文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" > 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_centerVertical="true" 
    android:padding="@dimen/padding_medium" 
    android:text="@string/hello_world" 
    tools:context=".MainActivity" /> 



    <TextView 
    android:id="@+id/textView1" 
    android:layout_width="fill_parent" 
    android:layout_height="30dp" 
    android:background="@drawable/repeat" 
    android:layout_marginTop="0dp" 
    android:text="" 
    android:textAppearance="?android:attr/textAppearanceLarge" /> 


    <com.google.android.maps.MapView 
     android:id="@+id/mapView" 
     android:layout_marginTop="30dp" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:enabled="true" 
     android:clickable="true" 
     android:apiKey="--private--" /> 

</RelativeLayout> 

- 一個在設備上,還有一個在模擬器上?

回答

1

要在真實硬件上測試,您需要使用與調試密鑰不同的密鑰。我認爲你正在使用調試密鑰庫。

訪問:https://developers.google.com/maps/documentation/android-api/v1/?csw=1#getfingerprint

閱讀谷歌的那款。

將應用程序導出爲具有與用於Google API(而不是調試密鑰)相同的密鑰的簽名應用程序很重要。

對於創建一個有效的閱讀段落:

訪問:http://developer.android.com/guide/publishing/app-signing.html#releasemode

,然後使用相同的密鑰來獲得谷歌地圖API密鑰。

一旦你有了你的應用程序的鑰匙,你可以導出一個簽名的應用程序,通過點擊鼠標右鍵在項目上選擇Android工具,然後導出爲一個已簽名的應用程序包,並按照嚮導(可能你可以創建一個使用該向導的新密鑰)。

希望有所幫助。