Android实验报告模板_实验二.doc_第1页
Android实验报告模板_实验二.doc_第2页
Android实验报告模板_实验二.doc_第3页
Android实验报告模板_实验二.doc_第4页
Android实验报告模板_实验二.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

电子信息学院实验报告书课程名:操作系统原理 题 目: 实验二 Android的视图层与UI设计 实验类别: 【验证、设计】 班 级: 学 号: 姓 名: 评语:学习态度 积极 一般 较差原理阐述 清晰 基本清晰 不清晰实验结果 正确 基本正确 部分正确思考题探究 深入 较深入 未做答书写规范性 规范 基本符合要求 未符合要就成绩: 指导教师: 林晓晨 批阅时间: 年 月 日 操作系统原理实验报告 - 10 -1、 实验题目Android的视图层与UI设计2、实验目的与要求(1)实验目的:让同学熟悉Android开发中的UI设计,包括了解和熟悉常用控件的使用、界面布局和事件时间处理等内容。 (2)实验要求: 1. 熟悉和掌握界面控件设计; 2. 了解Android界面布局; 3. 掌握常用控件的时限和属性设置; 4. 创建和使用定制的控件。3、实验步骤与源程序一、 常用控件1. 新建 “HelloUI” 工程,2. MainActivity.javapackage lin.example.helloui;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.widget.Button;public class MainActivity extends Activity Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView textView = (TextView)findViewById(R.id.textView1); Button button = (Button)findViewById(R.id.button1); 3. res/layout/activity_main.xml(1) Graphical Layout:Android中有许多常用控件:文本框:TextView、EditText按钮:Button、RadioButton、CheckBox、ImageButton列表:List、ExpandableListView、Spinner、AutoCompleteTextView、GridView、ImageView进度条:ProgressBar、ProgressDialog、SeekBar、RatingBar选择器:DatePicker、TimePicker菜单:Menu、ContentMenu对话框:Dialog、ProgressDialog常用的控件有文本框、按钮和列表等。控件的属性:可以直接在类中为控件设置属性,也可以在xml文件中设置属性。每个控件都有一系列的属性,例如id、size、text、color等等,大家可以找找API查看控件的属性。(2)ativity_main.xml: 4 运行Console: Android2014-05-03 15:43:52 - HelloUI -2014-05-03 15:43:52 - HelloUI Android Launch!2014-05-03 15:43:52 - HelloUI adb is running normally.2014-05-03 15:43:52 - HelloUI Performing lin.example.helloui.MainActivity activity launch2014-05-03 15:43:52 - HelloUI Automatic Target Mode: launching new emulator with compatible AVD AVD_for_3_7_WVGA_Nexus_One2014-05-03 15:43:52 - HelloUI Launching a new emulator with Virtual Device AVD_for_3_7_WVGA_Nexus_One2014-05-03 15:47:48 - HelloUI New emulator found: emulator-55542014-05-03 15:47:48 - HelloUI Waiting for HOME (cess.acore) to be launched.2014-05-03 15:50:54 - HelloUI HOME is up on device emulator-55542014-05-03 15:50:55 - HelloUI Uploading HelloUI.apk onto device emulator-55542014-05-03 15:50:58 - HelloUI Installing HelloUI.apk.2014-05-03 15:53:08 - HelloUI Success!2014-05-03 15:53:09 - HelloUI Starting activity lin.example.helloui.MainActivity on device emulator-55544、测试数据与实验结果二,界面布局1. 新建 ”Hellouib” 工程2. MainActivity.javapackage lin.example.hellouib;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.widget.Button;public class MainActivity extends Activity Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView textViewa = (TextView)findViewById(R.id.textView1); TextView textViewb = (TextView)findViewById(R.id.textView2); TextView textViewc = (TextView)findViewById(R.id.textView3); TextView textViewd = (TextView)findViewById(R.id.textView4); TextView textViewe = (TextView)findViewById(R.id.textView5); TextView textViewf = (TextView)findViewById(R.id.textView6); TextView textViewg = (TextView)findViewById(R.id.textView7); TextView textViewh = (TextView)findViewById(R.id.textView8); 4. activity_main.xml:(1)Graphical Layout:(2)ativity_main.xml: 4 运行Console: Android2014-05-03 16:42:31 - Hellouib -2014-05-03 16:42:31 - Hellouib Android Launch!2014-05-03 16:42:31 - Hellouib adb is running normally.2014-05-03 16:42:31 - Hellouib Performing lin.example.hellouib.MainActivity activity launch2014-05-03 16:42:31 - Hellouib Automatic Target Mode: launching new emulator with compatible AVD AVD_for_3_7_WVGA_Nexus_One2014-05-03 16:42:31 - Hellouib Launching a new emulator with Virtual Device AVD_for_3_7_WVGA_Nexus_One2014-05-03 16:43:10 - Emulator emulator: emulator window was out of view and was recentered2014-05-03 16:43:10 - Emulator 2014-05-03 16:43:11 - Hellouib New emulator found: emulator-55542014-05-03 16:43:11 - Hellouib Waiting for HOME (cess.acore) to be launched.2014-05-03 16:45:48 - Hellouib HOME is up on device emulator-55542014-05-03 16:45:48 - Hellouib Uploading Hellouib.apk onto device emulator-55542014-05-03 16:45:50 - Hellouib Installing Hellouib.apk.2014-05-03 16:47:26 - Hellouib Success!2014-05-03 16:47:26 - Hellouib Starting activity lin.example.hellouib.MainActivity on device emulator-55542014-05-03 16:47:31 - Hellouib ActivityManager: Starting: Intent act=ent.action.MAIN cat=e

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论