Android--MapView.第一個簡單的MapView
1.新建一個類,繼承MapActivity類,選擇Google APIs
2.在AndroidManifest.xml文件中添加map庫和網絡訪問權限
3.main.xml文件,此處的apiKey為你自己申請的key,
如何取得apiKey,請看 http://www.linuxidc.com/Linux/2013-02/79495.htm
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0LohYR7LZtdkVKy3GnPMW_TOEC4I9zd1xAlwxAQ"
android:clickable="true" />
</LinearLayout>