Android 开发调用 Google Maps
2010-02-27 23:58:00 来源:WEB开发网核心提示:<com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent"
- <com.google.android.maps.MapView
- android:id="@+id/mapview"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-
android:apiKey="0jOkQ80oD1JL9C6HAja99uGXCRiS2CGjKO_bc_g"
/>
- <view android:id="@+id/mv"
- class="com.google.android.maps.MapView"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1"
- android:apiKey="0jOkQ80oD1JL9C6HAja99uGXCRiS2CGjKO_bc_g"
- />
一定要在manifest.xml中设置全相应的权限,比如:
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
/>
- <uses-permission android:name="android.permission.INTERNET"
/>
- <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.package.name">
- ...
- <application android:name="MyApplication" >
- <uses-library android:name="com.google.android.maps" />
- ...
- </application>
- ...
- </manifest>