Android Google Map V2通过放大和放大获得空白屏幕;缩小但不显示地图
我按照你在年在网上给出的指示,我制作了这个应用程序&试着用我的galaxysiv运行它,但是得到了带有+和-按钮的空白屏幕,为了让你相信,我还将把项目的所有文件都给你。请帮帮我 1.AndroidManifest.xmlAndroid Google Map V2通过放大和放大获得空白屏幕;缩小但不显示地图,android,google-maps,Android,Google Maps,我按照你在年在网上给出的指示,我制作了这个应用程序&试着用我的galaxysiv运行它,但是得到了带有+和-按钮的空白屏幕,为了让你相信,我还将把项目的所有文件都给你。请帮帮我 1.AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.m
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapwithgps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission android:name="com.example.mapwithgps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapwithgps.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.mapwithgps.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="AIzaSyCNChGhmjHFvLp4atblSojMLvnnfg-_QZA" />
</application>
</manifest>
请帮助我运行应用程序。似乎您的api密钥有问题强>
尝试所有步骤的教程我看到你无意中发现了我的谷歌地图指南。首先,如果
minSDKVersion
为14,那么使用FragmentActivity
和SupportMapFragment
对象没有意义,您只需将它们更改为简单的Activity
和MapFragment
其次,如果您按照本指南的所有步骤进行操作,但仍然存在带有缩放控件的空白地图的问题,我建议您也阅读本指南:
并确保您在GoogleAPI控制台中生成并正确配置了密钥
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
package com.example.mapwithgps;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}