- 4
- 0
- 约1.86千字
- 约 7页
- 2016-04-13 发布于浙江
- 举报
android入门第二天
1、4
2、4
3、4
运行环境搭建
Sdk
VM
命令
知识点一:开发环境-eclipse
/android/eclipse
Window-preferences-android[sdk物理路径]
知识点二:创建Android Project
Project Name 英文+数字+_
Android某个系统版本
Application name :应用程序名称
Package Name:com.android.app
Activity Name:入口类名MainActivity
知识点三:项目结构介绍
知识点四:运行
启动android2.3虚拟机
运行-》项目右键-》run as -》Android Application
案例1:创建一个新的Activity
Step1:创建SecondActivity extends Acitity
重写 onCreate方法 Step2:修改ManiFest.xml文件,增加Activity的定义
activity android:name=.MainActivity
android:label=Myapplication
!-- 该Activtiy的运行顺序 --
intent-filter
action android:name=ent.action.VIEW /
category android:name=ent.category.DEFAULT /
/intent-filter
/activity
activity android:name=.SecondActivity
android:label=SecondApplication
!-- 该Activtiy的运行顺序为第一个 --
intent-filter
action android:name=ent.action.MAIN /
category android:name=ent.category.LAUNCHER /
/intent-filter
/activity Step3:在res\layout\创建一个secondlayou.xml文件 【右键-》new-》Android xml file】
!-- 标签显示文字,说明 --
TextView
!-- 横向填充窗口 --
android:layout_width=fill_parent
!-- 标签的高度和文字一样高 --
android:layout_height=wrap_content
!-- 标签中的文字说明 --
android:text=@string/hello
/ 案例二:点击按钮发生事件
Step1:定义事件源
Step2:定义事件过程
2-1、引入布局中的控件
2-2、编写一个类,实现监听的过程
2-3、注册监听器
Step3:运行 案例三:两个Activity传值
Step1:处理MainActivity 的布局TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=请输入您的姓名
/
EditText
android:layout_width=fill_parent
android:layout_height=wrap_content
/
Button
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=确认提交
/
3-2、事件过程
您可能关注的文档
最近下载
- 电动推杆市场分析报告.docx
- 深度解析(2026)《QCT 79.1-2008道路车辆 牵引车和挂车之间气制动连接用螺旋管总成 第1部分:尺寸》.pptx VIP
- 中小学生端午节假期安全教育主题班会PPT课件.pptx VIP
- 机器人等级考试三四级资料-第01课:初识Mixly和Fduino UNO.pptx VIP
- FULING富凌H200空压机中文说明书说明书用户手册.pdf
- Praat语音软件操作手册.docx VIP
- 2025-2026学年重庆市江津实验中学、田家炳中学、李市中学、白沙中学等金砖六校九年级(上)期末化学模拟试卷(含答案).pdf VIP
- 阿特拉斯•科普柯 冷冻式干燥机.pdf VIP
- TXFQC-合成橡胶消防水带.pdf VIP
- 重庆市九龙坡区渝高教育集团2024-2025学年九年级上学期期末考试物理试题(含答案).pdf VIP
原创力文档

文档评论(0)