【问题标题】:google map was not displayed in android emulator谷歌地图没有在安卓模拟器中显示
【发布时间】:2012-03-23 06:46:15
【问题描述】:

这是 XML 文件:

<com.google.android.maps.MapView
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:apiKey="0q7NUYm4bgzeXlqXtKYVPJDRWUJmt8Cu0gvbWMx"
                  android:id="@+id/map_view"
                 />

和清单文件:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
   <uses-library android:name="com.google.android.maps" />
    <activity
        android:label="@string/app_name"
        android:name=".MapsActivity" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

在 JAVA 文件中:

 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mapView = (MapView) findViewById(R.id.map_view);      
        mapView.setBuiltInZoomControls(true);

    }
    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }

我的问题是:地图没有显示。 我遇到了一个问题 Android 模拟器。

【问题讨论】:

  • 已生成您自己的 Map 密钥?
  • 您是否遇到任何异常,请发布。并确保您为 Map API 获得的密钥是最新的。还有一件事 MapKey 对于不同的机器是不同的......
  • 上述替代方案的简单步骤......technotalkative.com/…
  • 感谢您的回复错误:未能找到 com.google.settings 的提供者信息无法获取连接工厂客户端

标签: android android-maps


【解决方案1】:

你改变了清单

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

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


<application

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

</application>

【讨论】:

  • 不,亲爱的,它不起作用..实际上只有网格部分被显示,但地图消失了
【解决方案2】:

下载以下 APKs

com.android.vending-1.apk

com.google.android.gms-1.apk

使用 ADB 将这两个 APK 安装到您正在运行的(目标)模拟器中 命令:

adb -e install [path-to-APK-file]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-23
    • 2012-02-02
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多