图片:http://gyazo.com/860c43fcd216e324d1e2338c2836c704.png
清单:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.example.friendfinder.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAJAx2Q7_ZHiQYBNnz41IgS0O9vmi7auXM" />
</application>
<user-permission android:name="android.permission.INTERNET" />
</manifest>
activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<RealtiveLaout xmlns:android="http://schemas.android.com/apk/res/android"
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:enabled="true"
android:apiKey="AIzaSyAJAx2Q7_ZHiQYBNnz41IgS0O9vmi7auXM"
/>
</RealtiveLaout>
答案 0 :(得分:0)
您遗漏了"Specify settings in the Application Manifest"部分
中的一些内容1)权限
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
2)你的app权限
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
3)opengl要求
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />