开发者

Android google map not showing up on emulator

开发者 https://www.devze.com 2023-03-21 08:16 出处:网络
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all the steps but in the emulator the map doesnt show up it jus

I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all the steps but in the emulator the map doesnt show up it just displays boxes.Does any one have any idea what wrong am i doing.Logcat is below

This is my manifest file,

<?xml version="1.0" encoding="utf-8"?开发者_如何学C>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="gmap.com"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".GmapActivity"
              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>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

main.xml

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
  >
  <com.google.android.maps.MapView
             xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/map_view"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:clickable="true"
             android:enabled="true"
             android:apiKey="0YjDTTmg77HeTG-dfdfdfdfdWovpPSnatfUTrp5MQ"
             />
 </LinearLayout>

Logcat

 07-20 12:55:21.688: DEBUG/AndroidRuntime(389): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
 07-20 12:55:21.688: DEBUG/AndroidRuntime(389): CheckJNI is ON
 07-20 12:55:22.086: DEBUG/AndroidRuntime(389): --- registering native functions ---
 07-20 12:55:23.576: DEBUG/AndroidRuntime(389): Shutting down VM
 07-20 12:55:23.597: DEBUG/dalvikvm(389): Debugger has detached; object registry had 1 entries
 07-20 12:55:24.396: DEBUG/AndroidRuntime(397): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
 07-20 12:55:24.396: DEBUG/AndroidRuntime(397): CheckJNI is ON
 07-20 12:55:24.686: DEBUG/AndroidRuntime(397): --- registering native functions ---
 07-20 12:55:26.046: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=gmap.com/.GmapActivity }
 07-20 12:55:26.156: DEBUG/AndroidRuntime(397): Shutting down VM
 07-20 12:55:26.168: DEBUG/dalvikvm(397): Debugger has detached; object registry had 1 entries
 07-20 12:55:26.215: INFO/AndroidRuntime(397): NOTE: attach of thread 'Binder Thread #3' failed
 07-20 12:55:26.826: WARN/MapActivity(337): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@44ef1a08
 07-20 12:55:26.856: VERBOSE/MapActivity(337): Recycling map object.
 07-20 12:55:27.146: INFO/MapActivity(337): Handling network change notification:CONNECTED
 07-20 12:55:27.186: ERROR/MapActivity(337): Couldn't get connection factory client
 07-20 12:55:27.416: INFO/ActivityManager(59): Displayed activity gmap.com/.GmapActivity: 964 ms (total 964 ms)
 07-20 12:55:27.965: WARN/InputManagerService(59): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@44ee5428 (uid=10034 pid=353)
 07-20 12:55:33.666: DEBUG/dalvikvm(353): GC_EXPLICIT freed 9539 objects / 509864 bytes in 180ms


Well this is a small issue of signed key, Actually you have taken map key with your own keystore but currently your application is signed with default android debug.keystore . sign your application with the keystore with which you have generated map key and then install on emulator and run it

0

精彩评论

暂无评论...
验证码 换一张
取 消