结对项目小DEMO

本文介绍了一个简单的Android应用案例,主要内容包括两个页面间的跳转功能及利用多线程进行网络请求的方法。同时展示了XML布局文件,详细描述了登录界面与结果展示界面的设计。

这次小DEMO主要实现下面两个功能:

  1. 实现两个页面的相互跳转
  2. 通过多线程实现网络发送请求

本人负责界面与说明文档编写,搭档负责java代码的具体实现。

xml代码:

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical">
 6     <TextView
 7         android:id="@+id/tv1"
 8         android:layout_width="match_parent"
 9         android:layout_height="wrap_content"
10         android:text="登陆" />
11 
12     <LinearLayout
13         android:layout_width="match_parent"
14         android:layout_height="wrap_content">
15 
16         <TextView
17             android:id="@+id/tv2"
18             android:layout_width="wrap_content"
19             android:layout_height="wrap_content"
20             android:text="用户名:"/>
21 
22         <EditText
23             android:id="@+id/et1"
24             android:layout_width="match_parent"
25             android:layout_height="wrap_content" />
26 
27     </LinearLayout>
28 
29     <LinearLayout
30         android:layout_width="match_parent"
31         android:layout_height="wrap_content">
32 
33         <TextView
34             android:id="@+id/tv3"
35             android:layout_width="wrap_content"
36             android:layout_height="wrap_content"
37             android:text="密码:"/>
38 
39         <EditText
40             android:layout_width="match_parent"
41             android:layout_height="wrap_content" />
42     </LinearLayout>
43 
44     <Button
45         android:id="@+id/commit"
46         android:layout_width="wrap_content"
47         android:layout_height="wrap_content"
48         android:text="提交"/>
49     
50 </LinearLayout>
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical">
 6 
 7     <TextView
 8         android:id="@+id/name"
 9         android:layout_width="wrap_content"
10         android:layout_height="wrap_content"
11         android:text=""/>
12     <LinearLayout
13         android:layout_width="match_parent"
14         android:layout_height="wrap_content"
15         android:orientation="horizontal">
16         <LinearLayout
17             android:layout_width="wrap_content"
18             android:layout_height="wrap_content"
19             android:weightSum="1"
20             android:orientation="vertical">
21             <ImageView
22                 android:id="@+id/img1"
23                 android:layout_width="wrap_content"
24                 android:layout_height="wrap_content" />
25 
26             <Button
27                 android:id="@+id/btn1"
28                 android:layout_width="wrap_content"
29                 android:layout_height="wrap_content"
30                 android:text="恐怖片(图片)" />
31         </LinearLayout>
32         <LinearLayout
33             android:layout_width="wrap_content"
34             android:layout_height="wrap_content"
35             android:orientation="vertical">
36             <ImageView
37                 android:id="@+id/img2"
38                 android:layout_width="wrap_content"
39                 android:layout_height="wrap_content" />
40 
41             <Button
42                 android:id="@+id/btn2"
43                 android:layout_width="wrap_content"
44                 android:layout_height="wrap_content"
45                 android:text="科幻片(图片)" />
46         </LinearLayout>
47 
48     </LinearLayout>
49     
50      <Button
51          android:id="@+id/back"
52          android:layout_width="wrap_content"
53          android:layout_height="wrap_content"
54          android:text="返回"/>
55 
56 </LinearLayout>

 

显示效果:

软件说明文档:http://files.cnblogs.com/files/Wwwyyf/%E8%BD%AF%E4%BB%B6%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.pdf

转载于:https://www.cnblogs.com/Wwwyyf/p/6637484.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值