开发者

Unable to get GoogleMaps to display on Android

开发者 https://www.devze.com 2023-02-19 13:00 出处:网络
I\'m trying to get the GoogleMaps to display on either the emulator or my Android device .. preferably both.

I'm trying to get the GoogleMaps to display on either the emulator or my Android device .. preferably both.

I have gone thr开发者_如何学Goough everything on the internet about this and have had no luck

The Layout - Main.xml has the apiKey for my debug.keystore

<?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">
<TextView
  android:id="@+id/myLocationText"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
/>
<com.google.android.maps.MapView
  android:id="@+id/myMapView"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:enabled="true"
  android:clickable="true"
  **android:apiKey="0QVYGuX4_0vLI8Uro3uUP3GYvG539JlObdsXxHA"**
/>
</LinearLayout>

The manifest includes INTERNET and ACCESS_FINE_LOCATION permissions

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jt.com.whereami">
<application 
android:icon="@drawable/icon">
<uses-library android:name="com.google.android.maps"/>
<activity 
android:name=".WhereAmI"
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>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="7" />
</manifest>

The map shows up but only displays the boxes.

I'm using Eclipse to develop and everything else works fine.

Is there something I'm missing ?


As you said "The map shows up but only displays the boxes" means..i experienced similar type issue...that only cross marks appear on screen...

This is because of zoom level..U should setzoom for mapview to less for some 10 or so...!!

Hope this helps..


apiKey for my debug.keystore

for key debug Map API; if you want to see the Map, you must install directly from IDE (Ex: installation from Eclipse). this PC is used to creat MD5 and get the MAP API each PC have a MD5 unique

apiKey for publicication : it must install the application from file .apk to see the Map

0

精彩评论

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