移动计算与系统实验指导书.docx

上传人:b****1 文档编号:291505 上传时间:2023-04-28 格式:DOCX 页数:58 大小:865.52KB
下载 相关 举报
移动计算与系统实验指导书.docx_第1页
第1页 / 共58页
移动计算与系统实验指导书.docx_第2页
第2页 / 共58页
移动计算与系统实验指导书.docx_第3页
第3页 / 共58页
移动计算与系统实验指导书.docx_第4页
第4页 / 共58页
移动计算与系统实验指导书.docx_第5页
第5页 / 共58页
移动计算与系统实验指导书.docx_第6页
第6页 / 共58页
移动计算与系统实验指导书.docx_第7页
第7页 / 共58页
移动计算与系统实验指导书.docx_第8页
第8页 / 共58页
移动计算与系统实验指导书.docx_第9页
第9页 / 共58页
移动计算与系统实验指导书.docx_第10页
第10页 / 共58页
移动计算与系统实验指导书.docx_第11页
第11页 / 共58页
移动计算与系统实验指导书.docx_第12页
第12页 / 共58页
移动计算与系统实验指导书.docx_第13页
第13页 / 共58页
移动计算与系统实验指导书.docx_第14页
第14页 / 共58页
移动计算与系统实验指导书.docx_第15页
第15页 / 共58页
移动计算与系统实验指导书.docx_第16页
第16页 / 共58页
移动计算与系统实验指导书.docx_第17页
第17页 / 共58页
移动计算与系统实验指导书.docx_第18页
第18页 / 共58页
移动计算与系统实验指导书.docx_第19页
第19页 / 共58页
移动计算与系统实验指导书.docx_第20页
第20页 / 共58页
亲,该文档总共58页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

移动计算与系统实验指导书.docx

《移动计算与系统实验指导书.docx》由会员分享,可在线阅读,更多相关《移动计算与系统实验指导书.docx(58页珍藏版)》请在冰点文库上搜索。

移动计算与系统实验指导书.docx

移动计算与系统实验指导书

 

移动计算与系统实验指导书

目录

实验1---------Android开发环境安装与配置

实验2---------熟悉Android开发组件,基础UI设计

实验3---------SQLite数据库的建立

实验4---------SQLite数据库的操作

实验一:

Android开发环境安装与配置

【目的】

安装智能手机开发相关软件平台。

【要求】

1、完成智能手机开发平台安装、以及相关配置

2、并实现HelloWorld

3、了解项目的基本文件目录结构

【原理】

Eclipse安装原理,Android编程方法

【过程】

1、安装JAVAJDK

下载网址:

提示:

当前实验机器已安装

2.解压adt-bundle-windows-x86-20130219版本AndroidSDK和eclipse

提示:

当前系统已安装好,位于c:

\android-sdk-windows 中,目录下有platforms目录,并且已经添加C:

\android-sdk-windows\tools;C:

\android-sdk-windows\platform-tools 到PATH环境变量中。

3.创建AVD模拟器

(1)、eclipse->windows->AndroidVirtualDeviceManager

(2)、新建虚拟机,点击New...按钮

(3)、填写一些信息,如Name、SD卡大小...

(4)、创建后,会有一个确定框,并提示虚拟机的相关信息。

(5)、回到主界面,点击上面新建的虚拟机名称,再点击右边的Start...按钮启动

(6)、这里不需要设置,直接点Launch即可。

4、安装手机USB驱动

用模拟器调试,则可暂时不装。

5、建立新项目,实现HelloWorld。

OpenEclipse.

ClickthemenuFile->New->Project.

ExpandtheAndroidfolderandselectAndroidProject.

NametheprojectHelloWorld

得到的文件结构如下:

运行:

选运行的设备,可以是模拟器,也可以是真机(如果已经连接好真实手机的话):

 

模拟器运行:

真实手机调试:

6、用已有的APIDemo程序创建工程,玩转APIDemo各项功能

7、玩转手机,设置语言,安装第三方软件,比如QQ、Google输入法等

设置语言Settings---Language&…

8、创建第二模拟器AVD,启动,测试两个模拟器间拨打电话、发送短消息。

实验二:

熟悉Android开发组件,基础UI设计

目的:

掌握手机应用开发环境各种组件的使用,包括熟悉组件的各种属性,掌握移动应用界面的布局和设计方法,编写基础UI界面。

实验内容:

1.了解AndroidUI布局

ViewGroup通过各种Layout,控制所属View的显示位置

2.一个登录界面的实现

1).欢迎界面的xml代码

1.

xmlversion="1.0"encoding="utf-8"?

>

2.

android="

3.android:

orientation="vertical"

4.android:

background="@drawable/welcome_background"

5.android:

layout_width="fill_parent"

6.android:

layout_height="fill_parent">

7.

8.android:

layout_width="fill_parent"

9.android:

layout_height="fill_parent"

10.android:

background="@drawable/welcome_logo">

11.

12.android:

layout_width="fill_parent"

13.android:

layout_height="390dip"

14.>

15.

16.android:

text="@string/welcome_moto"

17.android:

layout_height="wrap_content"

18.android:

layout_width="wrap_content"

19.android:

layout_alignParentBottom="true"

20.android:

layout_centerHorizontal="true">

21.

22.

23.

2).欢迎界面的java代码(注意Handler那部分)

viewplaincopytoclipboardprint?

1.packagecom.TheMessenger.LifeTraXer;

2.importandroid.app.Activity;

3.importandroid.content.Intent;

4.importandroid.os.Bundle;

5.importandroid.os.Handler;

6.importandroid.util.Log;

7.importandroid.view.Window;

8.importandroid.view.WindowManager;

9.publicclassWelcomeextendsActivity{

10.privatefinalintSPLASH_DELAY_TIME=5000;

11.privateStringTag="WelcomeActivity";

12.

13.@Override

14.publicvoidonCreate(BundlesavedInstanceState){

15.Log.i(Tag,"onCreate()");

16.super.onCreate(savedInstanceState);

17.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

18.requestWindowFeature(Window.FEATURE_NO_TITLE);

19.setContentView(R.layout.welcome);

20.

21.newHandler().postDelayed(

22.newRunnable()

23.{

24.@Override

25.publicvoidrun(){

26.//TODOAuto-generatedmethodstub

27.startActivity(newIntent(Welcome.this,Login.class));

28.Welcome.this.finish();

29.}

30.

31.}

32.,SPLASH_DELAY_TIME);

33.}

34.}

3).登陆界面xml代码(看看嵌套的方式)

viewplaincopytoclipboardprint?

1.

xmlversion="1.0"encoding="utf-8"?

>

2.

3.xmlns:

android="

4.android:

orientation="vertical"

5.android:

background="@drawable/login_background"

6.android:

layout_width="fill_parent"

7.android:

layout_height="fill_parent">

8.

9.android:

layout_height="250dip"

10.android:

layout_width="fill_parent">

11.

12.android:

layout_centerHorizontal="true"

13.android:

layout_alignParentBottom="true"

14.android:

layout_height="200dip"

15.android:

layout_width="280dip"

16.android:

background="@drawable/login_input_area_background">

17.

18.android:

orientation="vertical"

19.android:

layout_height="160dip"

20.android:

layout_width="240dip"

21.android:

layout_centerInParent="true">

22.

23.android:

orientation="horizontal"

24.android:

layout_height="100dip"

25.android:

layout_width="fill_parent">

26.

27.android:

layout_width="80dip"

28.android:

layout_height="fill_parent"

29.android:

orientation="vertical"

30.android:

background="@drawable/login_input_area_logo_background">

31.

32.android:

layout_width="fill_parent"

33.android:

layout_height="80dip"

34.android:

src="@drawable/login_input_area_logo"/>

35.

36.android:

layout_width="fill_parent"

37.android:

layout_height="20dip"

38.android:

gravity="center_horizontal"

39.android:

text="@string/login_textview_app_name_text"

40.android:

textColor="@drawable/white"/>

41.

42.

43.android:

layout_width="160dip"

44.android:

paddingLeft="10dip"

45.android:

layout_height="fill_parent">

46.

47.android:

orientation="horizontal"

48.android:

layout_width="fill_parent"

49.android:

layout_height="48dip"

50.android:

layout_alignParentLeft="true"

51.android:

layout_alignParentTop="true">

52.

53.android:

layout_width="42dip"

54.android:

layout_height="50dip"

55.android:

text="@string/login_textview_username_text"

56.android:

textColor="@drawable/black"/>

57.

58.android:

id="@+id/login_edittext_username"

59.android:

padding="5dip"

60.android:

layout_width="108dip"

61.android:

layout_height="fill_parent"

62.android:

background="@drawable/login_edittext_background"

63.android:

textColor="@drawable/black"

64.android:

singleLine="true"/>

65.

66.

67.android:

orientation="horizontal"

68.android:

layout_width="fill_parent"

69.android:

layout_height="48dip"

70.android:

layout_alignParentLeft="true"

71.android:

layout_alignParentBottom="true">

72.

73.android:

layout_width="42dip"

74.android:

layout_height="50dip"

75.android:

text="@string/login_textview_password_text"

76.android:

textColor="@drawable/black"/>

77.

78.android:

id="@+id/login_edittext_password"

79.android:

padding="5dip"

80.android:

layout_width="108dip"

81.android:

layout_height="fill_parent"

82.android:

background="@drawable/login_edittext_background"

83.android:

textColor="@drawable/black"

84.android:

password="true"

85.android:

singleLine="true"/>

86.

87.

88.

89.

90.android:

layout_height="60dip"

91.android:

layout_width="fill_parent">

92.

93.android:

id="@+id/login_checkbox_remember_password"

94.android:

layout_height="40dip"

95.android:

layout_width="120dip"

96.android:

layout_alignParentLeft="true"

97.android:

layout_alignParentBottom="true"

98.android:

text="@string/login_checkbox_remember_password_text"

99.android:

textColor="@drawable/black"/>

100.

101.android:

id="@+id/login_button_log_in"

102.android:

layout_height="50dip"

103.android:

layout_width="120dip"

104.android:

gravity="center"

105.android:

background="@drawable/login_button_log_in_selector"

106.android:

layout_alignParentRight="true"

107.android:

layout_alignParentBottom="true"

108.android:

text="@string/login_button_log_in_text"

109.android:

textColor="@drawable/white"/>

110.

111.

112.

113.

114.

115.android:

layout_height="110dip"

116.android:

layout_width="fill_parent">

117.

118.android:

layout_width="280dip"

119.android:

layout_height="100dip"

120.android:

layout_centerInParent="true"

121.android:

background="@drawable/login_others_background">

122.

123.android:

orientation="vertical"

124.android:

layout_width="240dip"

125.android:

layout_height="80dip"

126.android:

layout_centerInParent="true">

127.

128.android:

orientation="horizontal"

129.android:

layout_width="fill_parent"

130.android:

layout_height="40dip">

131.

132.android:

layout_height="fill_parent"

133.android:

layout_width="wrap_content"

134.android:

gravity="center"

135.android:

text="@string/login_spinner_more_users_text"

136.android:

textColor="@drawable/black"/>

137.

138.android:

id="@+id/login_spinner_more_users"

139.android:

layout_height="fill_parent"

140.android:

layout_width="182dip"/>

141.

142.

143.android:

orientation="horizontal"

144.android:

layout_width="fill_parent"

145.android:

layout_height="40dip">

146.

147.android:

id="@+id/login_checkbox_auto_log_in"

148.android:

layout_width="120dip"

149.android:

layout_height="fill_parent"

150.android:

text="@string/login_checkbox_auto_log_in_text"

151.android:

textColor="@drawable/black"/>

152.

153.android:

id="@+id/login_checkbox_mute_log_in"

154.android:

layout_width="120dip"

155.android:

layout_height="fill_parent"

156.android:

text="@string/login_checkbox_mute_log_in_text"

157.android:

textColor="@drawable/black"/>

158.

159.

160.

161.

162.

163.android:

layout_width="fill_parent"

164.android:

layout_height="fill_parent">

165.

166.android:

orientation="horizontal"

167.android:

layout_height="40dip"

168.android:

layout_width="280dip"

169.android:

layout_alignParentBottom="true"

170.android:

layout_centerHorizontal="true"

171.android:

background="@drawable/login_bottom_bar_background"

172.android:

paddingLeft="1

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2