Android实验报告模板实验二.docx
《Android实验报告模板实验二.docx》由会员分享,可在线阅读,更多相关《Android实验报告模板实验二.docx(12页珍藏版)》请在冰豆网上搜索。
Android实验报告模板实验二
电子信息学院
实验报告书
课程名:
《操作系统原理》
题目:
实验二Android的视图层与UI设计
实验类别:
【验证、设计】
班级:
学号:
姓名:
1、实验题目
Android的视图层与UI设计
2、实验目的与要求
(1)实验目的:
让同学熟悉Android开发中的UI设计,包括了解和熟悉常用控件的使用、界面布局和事件时间处理等内容。
(2)实验要求:
1.熟悉和掌握界面控件设计;
2.了解Android界面布局;
3.掌握常用控件的时限和属性设置;
4.创建和使用定制的控件。
3、实验步骤与源程序
一、常用控件
1.新建“HelloUI”工程,
2.MainActivity.java
packagelin.example.helloui;
importandroid.app.Activity;
importandroid.os.Bundle;
importandroid.widget.TextView;
importandroid.widget.Button;
publicclassMainActivityextendsActivity{
@Override
publicvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextViewtextView=(TextView)findViewById(R.id.textView1);
Buttonbutton=(Button)findViewById(R.id.button1);
}
3.res/layout/activity_main.xml
(1)GraphicalLayout:
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:
android="xmlns:tools="android:orientation="vertical"android:id="@+id/container"android:layout_width="match_parent"android:layout_height="match_parent"tools:context="lin.example.helloui.MainActivity"tools:ignore="MergeRootFrame">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello"/>android:id="@+id/button1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Button"/>4运行Console:Android[2014-05-0315:43:52-HelloUI]------------------------------[2014-05-0315:43:52-HelloUI]AndroidLaunch![2014-05-0315:43:52-HelloUI]adbisrunningnormally.[2014-05-0315:43:52-HelloUI]Performinglin.example.helloui.MainActivityactivitylaunch[2014-05-0315:43:52-HelloUI]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:43:52-HelloUI]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:47:48-HelloUI]Newemulatorfound:emulator-5554[2014-05-0315:47:48-HelloUI]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0315:50:54-HelloUI]HOMEisupondevice'emulator-5554'[2014-05-0315:50:55-HelloUI]UploadingHelloUI.apkontodevice'emulator-5554'[2014-05-0315:50:58-HelloUI]InstallingHelloUI.apk...[2014-05-0315:53:08-HelloUI]Success![2014-05-0315:53:09-HelloUI]Startingactivitylin.example.helloui.MainActivityondeviceemulator-55544、测试数据与实验结果二,界面布局1.新建”Hellouib”工程2.MainActivity.javapackagelin.example.hellouib;importandroid.app.Activity;importandroid.os.Bundle;importandroid.widget.TextView;importandroid.widget.Button;publicclassMainActivityextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);TextViewtextViewa=(TextView)findViewById(R.id.textView1);TextViewtextViewb=(TextView)findViewById(R.id.textView2);TextViewtextViewc=(TextView)findViewById(R.id.textView3);TextViewtextViewd=(TextView)findViewById(R.id.textView4);TextViewtextViewe=(TextView)findViewById(R.id.textView5);TextViewtextViewf=(TextView)findViewById(R.id.textView6);TextViewtextViewg=(TextView)findViewById(R.id.textView7);TextViewtextViewh=(TextView)findViewById(R.id.textView8);}}4.activity_main.xml:(1)GraphicalLayout:(2)ativity_main.xml:android="xmlns:tools="android:id="@+id/container"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"tools:context="lin.example.hellouib.MainActivity"tools:ignore="MergeRootFrame">android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_weight="1">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1">android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>4运行Console:Android[2014-05-0316:42:31-Hellouib]------------------------------[2014-05-0316:42:31-Hellouib]AndroidLaunch![2014-05-0316:42:31-Hellouib]adbisrunningnormally.[2014-05-0316:42:31-Hellouib]Performinglin.example.hellouib.MainActivityactivitylaunch[2014-05-0316:42:31-Hellouib]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:42:31-Hellouib]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:43:10-Emulator]emulator:emulatorwindowwasoutofviewandwasrecentered[2014-05-0316:43:10-Emulator][2014-05-0316:43:11-Hellouib]Newemulatorfound:emulator-5554[2014-05-0316:43:11-Hellouib]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0316:45:48-Hellouib]HOMEisupondevice'emulator-5554'[2014-05-0316:45:48-Hellouib]UploadingHellouib.apkontodevice'emulator-5554'[2014-05-0316:45:50-Hellouib]InstallingHellouib.apk...[2014-05-0316:47:26-Hellouib]Success![2014-05-0316:47:26-Hellouib]Startingactivitylin.example.hellouib.MainActivityondeviceemulator-5554[2014-05-0316:47:31-Hellouib]ActivityManager:Starting:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=lin.example.hellouib/.MainActivity} 5、测试数据与实验结果把锁往右滑动,得到: 5、结果分析与实验体会
android="
xmlns:
tools="
android:
orientation="vertical"
id="@+id/container"
layout_width="match_parent"
layout_height="match_parent"
tools:
context="lin.example.helloui.MainActivity"
ignore="MergeRootFrame">
android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello"/>android:id="@+id/button1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Button"/>4运行Console:Android[2014-05-0315:43:52-HelloUI]------------------------------[2014-05-0315:43:52-HelloUI]AndroidLaunch![2014-05-0315:43:52-HelloUI]adbisrunningnormally.[2014-05-0315:43:52-HelloUI]Performinglin.example.helloui.MainActivityactivitylaunch[2014-05-0315:43:52-HelloUI]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:43:52-HelloUI]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:47:48-HelloUI]Newemulatorfound:emulator-5554[2014-05-0315:47:48-HelloUI]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0315:50:54-HelloUI]HOMEisupondevice'emulator-5554'[2014-05-0315:50:55-HelloUI]UploadingHelloUI.apkontodevice'emulator-5554'[2014-05-0315:50:58-HelloUI]InstallingHelloUI.apk...[2014-05-0315:53:08-HelloUI]Success![2014-05-0315:53:09-HelloUI]Startingactivitylin.example.helloui.MainActivityondeviceemulator-55544、测试数据与实验结果二,界面布局1.新建”Hellouib”工程2.MainActivity.javapackagelin.example.hellouib;importandroid.app.Activity;importandroid.os.Bundle;importandroid.widget.TextView;importandroid.widget.Button;publicclassMainActivityextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);TextViewtextViewa=(TextView)findViewById(R.id.textView1);TextViewtextViewb=(TextView)findViewById(R.id.textView2);TextViewtextViewc=(TextView)findViewById(R.id.textView3);TextViewtextViewd=(TextView)findViewById(R.id.textView4);TextViewtextViewe=(TextView)findViewById(R.id.textView5);TextViewtextViewf=(TextView)findViewById(R.id.textView6);TextViewtextViewg=(TextView)findViewById(R.id.textView7);TextViewtextViewh=(TextView)findViewById(R.id.textView8);}}4.activity_main.xml:(1)GraphicalLayout:(2)ativity_main.xml:android="xmlns:tools="android:id="@+id/container"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"tools:context="lin.example.hellouib.MainActivity"tools:ignore="MergeRootFrame">android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_weight="1">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1">android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>4运行Console:Android[2014-05-0316:42:31-Hellouib]------------------------------[2014-05-0316:42:31-Hellouib]AndroidLaunch![2014-05-0316:42:31-Hellouib]adbisrunningnormally.[2014-05-0316:42:31-Hellouib]Performinglin.example.hellouib.MainActivityactivitylaunch[2014-05-0316:42:31-Hellouib]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:42:31-Hellouib]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:43:10-Emulator]emulator:emulatorwindowwasoutofviewandwasrecentered[2014-05-0316:43:10-Emulator][2014-05-0316:43:11-Hellouib]Newemulatorfound:emulator-5554[2014-05-0316:43:11-Hellouib]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0316:45:48-Hellouib]HOMEisupondevice'emulator-5554'[2014-05-0316:45:48-Hellouib]UploadingHellouib.apkontodevice'emulator-5554'[2014-05-0316:45:50-Hellouib]InstallingHellouib.apk...[2014-05-0316:47:26-Hellouib]Success![2014-05-0316:47:26-Hellouib]Startingactivitylin.example.hellouib.MainActivityondeviceemulator-5554[2014-05-0316:47:31-Hellouib]ActivityManager:Starting:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=lin.example.hellouib/.MainActivity} 5、测试数据与实验结果把锁往右滑动,得到: 5、结果分析与实验体会
id="@+id/textView1"
layout_width="wrap_content"
layout_height="wrap_content"
text="Hello"/>
android:id="@+id/button1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Button"/>4运行Console:Android[2014-05-0315:43:52-HelloUI]------------------------------[2014-05-0315:43:52-HelloUI]AndroidLaunch![2014-05-0315:43:52-HelloUI]adbisrunningnormally.[2014-05-0315:43:52-HelloUI]Performinglin.example.helloui.MainActivityactivitylaunch[2014-05-0315:43:52-HelloUI]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:43:52-HelloUI]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0315:47:48-HelloUI]Newemulatorfound:emulator-5554[2014-05-0315:47:48-HelloUI]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0315:50:54-HelloUI]HOMEisupondevice'emulator-5554'[2014-05-0315:50:55-HelloUI]UploadingHelloUI.apkontodevice'emulator-5554'[2014-05-0315:50:58-HelloUI]InstallingHelloUI.apk...[2014-05-0315:53:08-HelloUI]Success![2014-05-0315:53:09-HelloUI]Startingactivitylin.example.helloui.MainActivityondeviceemulator-55544、测试数据与实验结果二,界面布局1.新建”Hellouib”工程2.MainActivity.javapackagelin.example.hellouib;importandroid.app.Activity;importandroid.os.Bundle;importandroid.widget.TextView;importandroid.widget.Button;publicclassMainActivityextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);TextViewtextViewa=(TextView)findViewById(R.id.textView1);TextViewtextViewb=(TextView)findViewById(R.id.textView2);TextViewtextViewc=(TextView)findViewById(R.id.textView3);TextViewtextViewd=(TextView)findViewById(R.id.textView4);TextViewtextViewe=(TextView)findViewById(R.id.textView5);TextViewtextViewf=(TextView)findViewById(R.id.textView6);TextViewtextViewg=(TextView)findViewById(R.id.textView7);TextViewtextViewh=(TextView)findViewById(R.id.textView8);}}4.activity_main.xml:(1)GraphicalLayout:(2)ativity_main.xml:android="xmlns:tools="android:id="@+id/container"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"tools:context="lin.example.hellouib.MainActivity"tools:ignore="MergeRootFrame">android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_weight="1">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1">android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>4运行Console:Android[2014-05-0316:42:31-Hellouib]------------------------------[2014-05-0316:42:31-Hellouib]AndroidLaunch![2014-05-0316:42:31-Hellouib]adbisrunningnormally.[2014-05-0316:42:31-Hellouib]Performinglin.example.hellouib.MainActivityactivitylaunch[2014-05-0316:42:31-Hellouib]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:42:31-Hellouib]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:43:10-Emulator]emulator:emulatorwindowwasoutofviewandwasrecentered[2014-05-0316:43:10-Emulator][2014-05-0316:43:11-Hellouib]Newemulatorfound:emulator-5554[2014-05-0316:43:11-Hellouib]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0316:45:48-Hellouib]HOMEisupondevice'emulator-5554'[2014-05-0316:45:48-Hellouib]UploadingHellouib.apkontodevice'emulator-5554'[2014-05-0316:45:50-Hellouib]InstallingHellouib.apk...[2014-05-0316:47:26-Hellouib]Success![2014-05-0316:47:26-Hellouib]Startingactivitylin.example.hellouib.MainActivityondeviceemulator-5554[2014-05-0316:47:31-Hellouib]ActivityManager:Starting:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=lin.example.hellouib/.MainActivity} 5、测试数据与实验结果把锁往右滑动,得到: 5、结果分析与实验体会
id="@+id/button1"
text="Button"/>
4运行
Console:
Android
[2014-05-0315:
43:
52-HelloUI]------------------------------
52-HelloUI]AndroidLaunch!
52-HelloUI]adbisrunningnormally.
52-HelloUI]Performinglin.example.helloui.MainActivityactivitylaunch
52-HelloUI]AutomaticTargetMode:
launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'
52-HelloUI]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'
47:
48-HelloUI]Newemulatorfound:
emulator-5554
48-HelloUI]WaitingforHOME('android.process.acore')tobelaunched...
50:
54-HelloUI]HOMEisupondevice'emulator-5554'
55-HelloUI]UploadingHelloUI.apkontodevice'emulator-5554'
58-HelloUI]InstallingHelloUI.apk...
53:
08-HelloUI]Success!
09-HelloUI]Startingactivitylin.example.helloui.MainActivityondeviceemulator-5554
4、测试数据与实验结果
二,界面布局
1.新建”Hellouib”工程
packagelin.example.hellouib;
TextViewtextViewa=(TextView)findViewById(R.id.textView1);
TextViewtextViewb=(TextView)findViewById(R.id.textView2);
TextViewtextViewc=(TextView)findViewById(R.id.textView3);
TextViewtextViewd=(TextView)findViewById(R.id.textView4);
TextViewtextViewe=(TextView)findViewById(R.id.textView5);
TextViewtextViewf=(TextView)findViewById(R.id.textView6);
TextViewtextViewg=(TextView)findViewById(R.id.textView7);
TextViewtextViewh=(TextView)findViewById(R.id.textView8);
4.activity_main.xml:
android="xmlns:tools="android:id="@+id/container"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"tools:context="lin.example.hellouib.MainActivity"tools:ignore="MergeRootFrame">android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_weight="1">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1">android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>4运行Console:Android[2014-05-0316:42:31-Hellouib]------------------------------[2014-05-0316:42:31-Hellouib]AndroidLaunch![2014-05-0316:42:31-Hellouib]adbisrunningnormally.[2014-05-0316:42:31-Hellouib]Performinglin.example.hellouib.MainActivityactivitylaunch[2014-05-0316:42:31-Hellouib]AutomaticTargetMode:launchingnewemulatorwithcompatibleAVD'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:42:31-Hellouib]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'[2014-05-0316:43:10-Emulator]emulator:emulatorwindowwasoutofviewandwasrecentered[2014-05-0316:43:10-Emulator][2014-05-0316:43:11-Hellouib]Newemulatorfound:emulator-5554[2014-05-0316:43:11-Hellouib]WaitingforHOME('android.process.acore')tobelaunched...[2014-05-0316:45:48-Hellouib]HOMEisupondevice'emulator-5554'[2014-05-0316:45:48-Hellouib]UploadingHellouib.apkontodevice'emulator-5554'[2014-05-0316:45:50-Hellouib]InstallingHellouib.apk...[2014-05-0316:47:26-Hellouib]Success![2014-05-0316:47:26-Hellouib]Startingactivitylin.example.hellouib.MainActivityondeviceemulator-5554[2014-05-0316:47:31-Hellouib]ActivityManager:Starting:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=lin.example.hellouib/.MainActivity} 5、测试数据与实验结果把锁往右滑动,得到: 5、结果分析与实验体会
layout_width="fill_parent"
layout_height="fill_parent"
context="lin.example.hellouib.MainActivity"
android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_weight="1">android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>
orientation="horizontal"
layout_weight="1">
android:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="red"android:gravity="center_horizontal"android:background="#aa0000"android:layout_weight="1"/>android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>
text="red"
gravity="center_horizontal"
background="#aa0000"
layout_weight="1"/>
android:id="@+id/textView2"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="green"android:gravity="center_horizontal"android:background="#00aa00"android:layout_weight="1"/>android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>
id="@+id/textView2"
text="green"
background="#00aa00"
android:id="@+id/textView3"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="blue"android:gravity="center_horizontal"android:background="#0000aa"android:layout_weight="1"/>android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>
id="@+id/textView3"
text="blue"
background="#0000aa"
android:id="@+id/textView4"android:layout_width="wrap_content"android:layout_height="fill_parent"android:text="yellow"android:gravity="center_horizontal"android:background="#aaaa00"android:layout_weight="1"/>
id="@+id/textView4"
text="yellow"
background="#aaaa00"
android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1">android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>
android:id="@+id/textView5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowone"android:textSize="15pt"/>android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>
id="@+id/textView5"
layout_weight="1"
text="rowone"
textSize="15pt"/>
android:id="@+id/textView6"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowtwo"android:textSize="15pt"/>android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>
id="@+id/textView6"
text="rowtwo"
android:id="@+id/textView7"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowthree"android:textSize="15pt"/>android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>
id="@+id/textView7"
text="rowthree"
android:id="@+id/textView8"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight="1"android:text="rowfour"android:textSize="15pt"/>
id="@+id/textView8"
text="rowfour"
[2014-05-0316:
42:
31-Hellouib]------------------------------
31-Hellouib]AndroidLaunch!
31-Hellouib]adbisrunningnormally.
31-Hellouib]Performinglin.example.hellouib.MainActivityactivitylaunch
31-Hellouib]AutomaticTargetMode:
31-Hellouib]LaunchinganewemulatorwithVirtualDevice'AVD_for_3_7_WVGA_Nexus_One'
10-Emulator]emulator:
emulatorwindowwasoutofviewandwasrecentered
10-Emulator]
11-Hellouib]Newemulatorfound:
11-Hellouib]WaitingforHOME('android.process.acore')tobelaunched...
45:
48-Hellouib]HOMEisupondevice'emulator-5554'
48-Hellouib]UploadingHellouib.apkontodevice'emulator-5554'
50-Hellouib]InstallingHellouib.apk...
26-Hellouib]Success!
26-Hellouib]Startingactivitylin.example.hellouib.MainActivityondeviceemulator-5554
31-Hellouib]ActivityManager:
Starting:
Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=lin.example.hellouib/.MainActivity}
5、测试数据与实验结果
把锁往右滑动,得到:
5、结果分析与实验体会
下载文档到电脑,查找使用更方便
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
copyright@ 2008-2022 冰点文档网站版权所有
经营许可证编号:鄂ICP备2022015515号-1