Android--MapView.第一个简单的MapView

2014-11-24 08:12:44 · 作者: · 浏览: 3

1.新建一个类,继承MapActivity类,选择Google APIs



2.在AndroidManifest.xml文件中添加map库和网络访问权限




3.main.xml文件,此处的apiKey为你自己申请的key,


< xml version="1.0" encoding="utf-8" >
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >


android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0LohYR7LZtdkVKy3GnPMW_TOEC4I9zd1xAlwxAQ"
android:clickable="true" />