码迷,mamicode.com
首页 > 移动开发 > 详细

ANDROID_MARS学习笔记_S03_007_GoogleMap1

时间:2016-02-20 23:00:04      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:

一、简介

技术分享

技术分享

二、代码
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

标签:

原文地址:http://www.cnblogs.com/shamgod/p/5204152.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!