当我运行我的应用程序(谷歌地图应用程序)时,我看不到地图。我只看到一个白屏(如下图所示)。
主要节日
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.williamroma.example"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<!-- Add Google Map Library -->
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".GoogleMapActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<!-- Allow to connect with internet -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
活动
package com.williamroma.example;
import com.google.android.maps.MapActivity;
import android.app.Activity;
import android.os.Bundle;
public class GoogleMapActivity extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
这是我看到的屏幕,我想在这个 tuotiral http://www.androidhive.info/2012/01/android-working-with-google-maps/中看到地图
布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="AIzaSyCyk2MVC5Fyl7HIB3iHlPgyRqvOF-VXYJw"
/>
</RelativeLayout>
编辑
我在 logcat 中收到了橙色的这些消息
03-31 11:31:16.140: I/Process(1787): Sending signal. PID: 1787 SIG: 9
03-31 11:31:40.940: I/MapActivity(1832): Handling network change notification:CONNECTED
03-31 11:31:40.940: E/MapActivity(1832): Couldn't get connection factory client
03-31 11:31:41.011: D/dalvikvm(1832): GC_CONCURRENT freed 170K, 4% free 9316K/9607K, paused 8ms+6ms
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.020: D/gralloc_goldfish(1832): Emulator without GPU emulation detected.
03-31 11:31:42.470: W/System.err(1832): IOException processing: 26
03-31 11:31:42.470: W/System.err(1832): java.io.IOException: Server returned: 3
03-31 11:31:42.490: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-31 11:31:42.490: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-31 11:31:42.500: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-31 11:31:42.500: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-31 11:31:42.520: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
03-31 11:31:42.520: W/System.err(1832): at java.lang.Thread.run(Thread.java:856)