移动计算与系统实验指导书Word文档格式.docx

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

移动计算与系统实验指导书Word文档格式.docx

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

移动计算与系统实验指导书Word文档格式.docx

(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.<

LinearLayoutxmlns:

android="

3.android:

orientation="

vertical"

4.android:

background="

@drawable/welcome_background"

5.android:

layout_width="

fill_parent"

6.android:

layout_height="

7.<

LinearLayout

8.android:

9.android:

10.android:

@drawable/welcome_logo"

11.<

RelativeLayout

12.android:

13.android:

390dip"

14.>

15.<

TextView

16.android:

text="

@string/welcome_moto"

17.android:

wrap_content"

18.android:

19.android:

layout_alignParentBottom="

true"

20.android:

layout_centerHorizontal="

<

/TextView>

21.<

/RelativeLayout>

22.<

/LinearLayout>

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代码(看看嵌套的方式)

3.xmlns:

@drawable/login_background"

7.android:

8.<

250dip"

14.android:

200dip"

15.android:

280dip"

@drawable/login_input_area_background"

17.<

160dip"

240dip"

21.android:

layout_centerInParent="

23.android:

horizontal"

24.android:

100dip"

25.android:

26.<

27.android:

80dip"

28.android:

29.android:

30.android:

@drawable/login_input_area_logo_background"

31.<

ImageView

32.android:

33.android:

34.android:

src="

@drawable/login_input_area_logo"

/>

35.<

36.android:

37.android:

20dip"

38.android:

gravity="

center_horizontal"

39.android:

@string/login_textview_app_name_text"

40.android:

textColor="

@drawable/white"

41.<

42.<

43.android:

44.android:

paddingLeft="

10dip"

45.android:

46.<

47.android:

48.android:

49.android:

48dip"

50.android:

layout_alignParentLeft="

51.android:

layout_alignParentTop="

52.<

53.android:

42dip"

54.android:

50dip"

55.android:

@string/login_textview_username_text"

56.android:

@drawable/black"

57.<

EditText

58.android:

id="

@+id/login_edittext_username"

59.android:

padding="

5dip"

60.android:

108dip"

61.android:

62.android:

@drawable/login_edittext_background"

63.android:

64.android:

singleLine="

65.<

66.<

67.android:

68.android:

69.android:

70.android:

71.android:

72.<

73.android:

74.android:

75.android:

@string/login_textview_password_text"

76.android:

77.<

78.android:

@+id/login_edittext_password"

79.android:

80.android:

81.android:

82.android:

83.android:

84.android:

password="

85.android:

86.<

87.<

88.<

89.<

90.android:

60dip"

91.android:

92.<

CheckBox

93.android:

@+id/login_checkbox_remember_password"

94.android:

40dip"

95.android:

120dip"

96.android:

97.android:

98.android:

@string/login_checkbox_remember_password_text"

99.android:

100.<

Button

101.android:

@+id/login_button_log_in"

102.android:

103.android:

104.android:

center"

105.android:

@drawable/login_button_log_in_selector"

106.android:

layout_alignParentRight="

107.android:

108.android:

@string/login_button_log_in_text"

109.android:

110.<

111.<

112.<

113.<

114.<

115.android:

110dip"

116.android:

117.<

118.android:

119.android:

120.android:

121.android:

@drawable/login_others_background"

122.<

123.android:

124.android:

125.android:

126.android:

127.<

128.android:

129.android:

130.android:

131.<

132.android:

133.android:

134.android:

135.android:

@string/login_spinner_more_users_text"

136.android:

137.<

Spinner

138.android:

@+id/login_spinner_more_users"

139.android:

140.android:

182dip"

141.<

142.<

143.android:

144.android:

145.android:

146.<

147.android:

@+id/login_checkbox_auto_log_in"

148.android:

149.android:

150.android:

@string/login_checkbox_auto_log_in_text"

151.android:

152.<

153.android:

@+id/login_checkbox_mute_log_in"

154.android:

155.android:

156.android:

@string/login_checkbox_mute_log_in_text"

157.android:

158.<

159.<

160.<

161.<

162.<

163.android:

164.android:

165.<

166.android:

167.android:

168.android:

169.android:

170.android:

171.android:

@drawable/login_bottom_bar_background"

172.android:

1

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

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

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

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