2012-09-23 94 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工具,然后导出为一个已签名的应用程序包,并按照向导(可能你可以创建一个使用该向导的新密钥)。

希望有所帮助。