ANDROID_MARS学习笔记_S03_007_GoogleMap1

一、简介

ANDROID_MARS学习笔记_S03_007_GoogleMap1_第1张图片

ANDROID_MARS学习笔记_S03_007_GoogleMap1_第2张图片

二、代码
1.xml
(1)main.xml

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:orientation="vertical"
 4     android:layout_width="fill_parent"
 5     android:layout_height="fill_parent"
 6     >
 7     <com.google.android.maps.MapView
 8         android:layout_width="fill_parent"
 9         android:layout_height="fill_parent"
10         android:enabled="true"
11         android:clickable="true"
12         android:apiKey="0pkT0EYxPi2VZ5beDaJ0g08aCtWGmKTFnOvj6iw"
13         />
14 </LinearLayout>

 

(2)AndroidManifest.xml

1   <uses-permission android:name="android.permission.INTERNET" />   

 

2.java
(1)MainActivity.java

 1 package com.se7en;
 2 
 3 import android.os.Bundle;
 4 
 5 import com.google.android.maps.MapActivity;
 6 import com.se7en.R;
 7 
 8 /**
 9  * 注意要在AndroidManifest.xml文件中添加库及权限设置
10  * @author se7en
11  *
12  */
13 public class MainActivity extends MapActivity {
14     /** Called when the activity is first created. */
15     @Override
16     public void onCreate(Bundle savedInstanceState) {
17         super.onCreate(savedInstanceState);
18         setContentView(R.layout.main);
19     }
20 
21     @Override
22     protected boolean isRouteDisplayed() {
23         // TODO Auto-generated method stub
24         return false;
25     }
26    
27 }

 

 

 

你可能感兴趣的:(ANDROID_MARS学习笔记_S03_007_GoogleMap1)