




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、簡(jiǎn)單聊天通信軟件1.題目基于Android的簡(jiǎn)單聊天通信軟件設(shè)計(jì)(1)歡迎界面(2)登錄界面,登錄界面中選擇對(duì)方的IP地址和端口號(hào)(3)與對(duì)方實(shí)現(xiàn)連接。實(shí)現(xiàn)點(diǎn)對(duì)點(diǎn)的通信。即點(diǎn)對(duì)點(diǎn)的聊天。(4)聊天界面中,包括顯示對(duì)方信息、聊天內(nèi)容顯示框、聊天內(nèi)容輸入框,以及發(fā)送按鈕等(5)擴(kuò)展1:實(shí)現(xiàn)表情的發(fā)送和顯示,或者實(shí)現(xiàn)圖片的發(fā)送和顯示。(5)擴(kuò)展2:實(shí)現(xiàn)多人聊天。1.1需求分析設(shè)計(jì)一個(gè)基于安卓系統(tǒng)的簡(jiǎn)單聊天通信軟件,軟件要實(shí)現(xiàn)點(diǎn)對(duì)點(diǎn)的通信。UI:自己設(shè)計(jì)好符合軟件的界面,使軟件成熟化。拓展:如有能力可使軟件實(shí)現(xiàn)多人聊天,發(fā)生圖片等。1.概要設(shè)計(jì)2.1流程圖1.2詳細(xì)設(shè)計(jì)main.xml:歡迎界面,延遲
2、2秒左右自動(dòng)跳轉(zhuǎn)。Hello.java為其響應(yīng)目錄。password.xml:登錄界面,驗(yàn)證用戶輸入信息,錯(cuò)誤時(shí)用戶可重新輸入,正確后方可進(jìn)password.java為其響應(yīng)目錄。findpassword.xml:在登錄界面中點(diǎn)擊“忘記密碼”后的跳轉(zhuǎn)頁(yè)面,可通過注冊(cè)時(shí)的郵箱找回密碼,但此功能目前還未實(shí)現(xiàn),只有界面。巾ndpassword.java為其響應(yīng)目錄。create_id.xml:在登錄界面中點(diǎn)擊“創(chuàng)建新賬號(hào)”后的跳轉(zhuǎn)頁(yè)面,也還未實(shí)現(xiàn)其功能。create_id為其應(yīng)目錄。main_menu.xml:登錄后的主菜單,包括“聊天”、“聯(lián)系人”、“查找”等功能,均為圖片按main_menu.j
3、ava為其響應(yīng)目錄。chat.xml:在主菜單中點(diǎn)擊“聊天”后的聊天界面,輸入IP地址后聯(lián)系,可與進(jìn)入相同服務(wù)器的用戶聊天,聊天內(nèi)容顯示在對(duì)話框中。chat.java為其響應(yīng)目錄。profile.xml:在主菜單中點(diǎn)擊“我的資料”的跳轉(zhuǎn)頁(yè)面,顯示用戶的一些信息。profile.java為其響應(yīng)目錄。feedback.xml:在主菜單中點(diǎn)擊“反饋我們”的跳轉(zhuǎn)頁(yè)面,用戶可在此頁(yè)面告訴我們一些意見,但此功能目前還未實(shí)現(xiàn)。feedback.java為其響應(yīng)目錄。about.xml:在主菜單中點(diǎn)擊“關(guān)于”的跳轉(zhuǎn)頁(yè)面,顯示一些版本信息。about.java為其響應(yīng)目錄。setting.xml:在主菜單中點(diǎn)
4、擊設(shè)置按鈕后的跳轉(zhuǎn)頁(yè)面,具內(nèi)容包括“切換賬號(hào)”和“退出”。setting.java為其響應(yīng)目錄。2.3操作界面軟件圖標(biāo):LocaleDownloadsEmailGalleryKui002MessagingMusicPhoneSearchSettingsSpeechRecorder£ill7:193B7:21點(diǎn)滴"解押隙滴號(hào)/手機(jī)號(hào)/郵箱地址密碼登錄顯示密碼J點(diǎn)滴晴輸入你的注冊(cè)郵箱密碼重置連接將發(fā)送到你注冊(cè)的郵箱,如未能收取郵件,請(qǐng)檢查"垃圾郵件重置密碼蔡M7:26點(diǎn)滴正在聊天:點(diǎn)滴反饋我們Xmli7:42源程序main.xml:歡迎界面代碼<?xmlvers
5、ion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http:android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><ImageViewandroid:id="+id/helloimage"android:src="drawable
6、/welcome"android:layout_width="fill_parent"android:layout_height="fill_parent"/></LinearLayout>password.xml:登錄界面代碼<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http:android:layout_width="wrap_content"an
7、droid:layout_height="wrap_content"android:background="drawable/login"><EditTextandroid:id="+id/name"android:layout_width="300dp"android:layout_height="45dp"android:textSize="16sp"android:layout_centerHorizontal="true"android
8、:layout_alignParentRight="true"android:layout_marginRight="10dip"android:layout_marginTop="170dip"android:hint="點(diǎn)滴號(hào)/手機(jī)號(hào)/郵箱地址"/><EditTextandroid:id="+id/password"android:layout_width="300dp"android:layout_height="45dp"android
9、:textSize="16sp"android:layout_below="id/name"android:layout_alignRight="id/name"android:inputType="textPassword"android:hint="密碼"/><Buttonandroid:id="+id/login"android:layout_width="100dp"android:layout_height="45dp&qu
10、ot;android:textSize="16sp"android:textColor="#1d5972"android:layout_below="id/password"android:layout_alignRight="id/name"android:text="登錄"/><CheckBoxandroid:id="+id/showpassword"android:layout_width="wrap_content"android:la
11、yout_height="wrap_content"android:layout_toLeftOf="id/login"android:layout_alignLeft="id/name"android:layout_alignBottom="id/login"android:textSize="14sp"android:text="顯示密碼"/><Buttonandroid:id="+id/forgetpassword"android:lay
12、out_width="wrap_content"android:layout_height="wrap_content"android:textSize="14sp"android:layout_below="id/login"android:layout_alignLeft="id/name"android:layout_marginTop="5dip"android:background="android:color/transparent"andro
13、id:text="忘記密碼?"/><Buttonandroid:id="+id/createid"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="14sp"android:layout_below="id/forgetpassword"android:layout_alignLeft="id/name"android
14、:layout_marginTop="5dip"android:background="android:color/transparent"android:text="創(chuàng)建新賬號(hào)”/></RelativeLayout>findpassword.xml:忘記密碼界面代碼<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http:android:orientation="ver
15、tical"android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="#1d5972"><EditTextandroid:id="+id/enteremail"android:layout_width="300dp"android:layout_height="45dp"android:textSize="15sp"
16、android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:layout_marginTop="65dp"android:hint="請(qǐng)輸入你的注冊(cè)郵箱"/><TextViewandroid:layout_width="300dp"android:layout_height="45dp"android:textSize="15sp"android:l
17、ayout_below="id/enteremail"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:background="android:color/transparent"android:text="密碼重置連接將發(fā)送到你注冊(cè)的郵箱,如未能收取郵件,請(qǐng)檢查“垃圾郵件”/>Buttonandroid:id="+id/reset"android:layout_width=
18、"300dp"android:layout_height="45dp"android:textSize="16sp"android:layout_below="id/reset_text"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:layout_marginTop="10dp"android:textColor="#1d5872&quo
19、t;android:text="重置密碼"/></LinearLayout>create_id.xml:創(chuàng)建新賬號(hào)界面代碼<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http:android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="#1d
20、5972"><TextViewandroid:layout_width="300dp"android:layout_height="wrap_content"android:textSize="15sp"android:gravity="center"android:layout_alignParentLeft="true"android:layout_marginLeft="10dp"android:layout_marginTop="65d
21、p"android:background="android:color/transparent"android:text="由于程序員技術(shù)不成熟,如需注冊(cè)請(qǐng)上:"/><TextViewandroid:layout_width="300dp"android:layout_height="wrap_content"android:textSize="15sp"android:gravity="center"android:layout_below="
22、;id/zhuce"android:layout_alignParentLeft="true"android:layout_marginLeft="10dp"android:background="android:color/transparent"android:text=""/></LinearLayout>main_menu.xml:主菜單界面代碼<?xmlversion="1.0"encoding="utf-8"?><Re
23、lativeLayoutxmlns:android="http:android:layout_width="wrap_content"android:layout_height="wrap_content"android:background="drawable/background"><Buttonandroid:id="+id/setting"android:layout_width="50dp"android:layout_alignParentLeft="
24、true"android:layout_marginLeft="261dp"android:layout_marginTop="9dp"android:background="drawable/setting"/><Buttonandroid:id="+id/chat"android:layout_width="250dp”android:layout_height="32dp"android:layout_centerHorizontal="true&
25、quot;android:layout_marginTop="85dp"android:background="drawable/chat"/><Buttonandroid:id="+id/contract"android:layout_width="250dp”android:layout_height="32dp"android:layout_below="id/chat"android:layout_centerHorizontal="true"a
26、ndroid:layout_marginTop="20dp"android:background="drawable/contract"/><Buttonandroid:id="+id/find"android:layout_width="250dp”android:layout_height="32dp"android:layout_below="id/contract"android:layout_centerHorizontal="true"and
27、roid:layout_marginTop="20dp"android:background="drawable/find"/><Buttonandroid:id="+id/profile"android:layout_width="250dp”android:layout_below="id/find"android:layout_centerHorizontal="true"android:layout_marginTop="20dp"android
28、:background="drawable/profile"/><Buttonandroid:id="+id/feedback"android:layout_width="250dp”android:layout_height="32dp"android:layout_below="id/profile"android:layout_centerHorizontal="true"android:layout_marginTop="20dp"android
29、:background="drawable/feedback"/><Buttonandroid:id="+id/about_button"android:layout_width="250dp”android:layout_height="32dp"android:layout_below="id/feedback"android:layout_centerHorizontal="true"android:layout_marginTop="20dp"a
30、ndroid:background="drawable/about_button"/></RelativeLayout>chat.xml:聊天界面代碼<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http:android:layout_width="wrap_content"android:layout_height="wrap_content"android:ba
31、ckground="drawable/chat_bg"><Buttonandroid:id="+id/return_button"android:layout_width="50dp"android:layout_height="32dp"android:layout_alignParentLeft="true"android:layout_marginLeft="9dp"android:layout_marginTop="9dp"androi
32、d:background="drawable/return_button"/><EditTextandroid:id="+id/edit0"android:layout_width="135dp”android:layout_height="40dp"android:textSize="13sp"android:layout_below="id/return_button"android:layout_alignParentLeft="true"andr
33、oid:layout_marginTop="15dp"android:hint="IP地址"/><EditTextandroid:layout_width="135dp”android:layout_height="40dp"android:textSize="13sp"android:layout_below="id/return_button"android:layout_toRightOf="id/edit0"android:layout_marg
34、inTop="15dp"android:hint="用戶名"android:id="+id/edit1"/><Buttonandroid:id="+id/button1"android:layout_width="fill_parent"android:layout_height="40dp"android:textSize="13sp"android:textColor="#1d5972"android:layout_be
35、low="id/return_button"android:layout_toRightOf="id/edit1"android:layout_marginTop="15dp"android:text="連接"/><EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:textSize="15sp"android:text=&q
36、uot;"android:layout_below="id/edit0"android:background="android:color/transparent"android:id="+id/edit3"/><EditTextandroid:layout_width="270dp"android:layout_height="40dp"android:textSize="13sp"android:layout_alignParentLeft=&quo
37、t;true"android:layout_alignParentBottom="true"android:text=""android:id="+id/edit2"/><Buttonandroid:layout_width="50dp"android:layout_height="40dp"android:textColor="#1d5972"android:layout_alignParentRight="true"android
38、:layout_alignParentBottom="true"android:text="發(fā)送"android:id="+id/button2"/></RelativeLayout>profile.xml:我的資料界面代碼<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http:<Buttonandroid:id="+id/return_button
39、"android:layout_width="50dp"android:layout_height="32dp"android:layout_alignParentLeft="true"android:layout_marginLeft="9dp"android:layout_marginTop="9dp"android:background="drawable/return_button"/><ImageViewandroid:id="+id
40、/myphoto"android:layout_width="100dp"android:layout_height="100dp"/>android:layout_below="id/return_button"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:layout_marginTop="25dip"android:src="drawa
41、ble/myphoto"/><TextViewandroid:id="+id/myname"android:layout_width="300dp"android:layout_height="wrap_content"android:textSize="15sp"android:textColor="#1d5972"android:layout_below="id/myphoto"android:layout_alignParentLeft="
42、;true"android:layout_marginLeft="10dip"android:text="昵稱Never"/><TextViewandroid:id="+id/mysex"android:layout_width="300dp"android:layout_height="wrap_content"android:textSize="15sp"android:textColor="#1d5972"android:lay
43、out_below="id/myname"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:text="性另1J女"/><TextViewandroid:id="+id/mycity"android:layout_width="300dp"android:layout_height="wrap_content"android:textSiz
44、e="15sp"android:textColor="#1d5972"android:layout_below="id/mysex"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:text="地區(qū)廣西"/></RelativeLayout>feedback.xml:反饋我們界面代碼<?xmlversion="1.0"encod
45、ing="utf-8"?><LinearLayoutxmlns:android="http:android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="drawable/feedback_bg"><Buttonandroid:id="+id/return_button"android:layout_height="32dp"a
46、ndroid:layout_alignParentLeft="true"android:layout_marginLeft="9dp"android:layout_marginTop="9dp"android:background="drawable/return_button"/><TextViewandroid:id="+id/suggestion"android:layout_width="300dp"android:layout_height="
47、wrap_content"android:textSize="15sp"android:layout_below="id/return_button"android:layout_alignParentLeft="true"android:layout_marginLeft="10dip"android:layout_marginTop="15dp"android:background="android:color/transparent"android:hint=
48、"告訴我們你的意見"/><EditTextandroid:id="+id/whitesuggestion"android:layout_width="300dp"android:layout_height="330dp"android:textSize="15sp"android:layout_below="id/suggestion"android:layout_alignParentLeft="true"android:layout_mar
49、ginLeft="10dip"android:text=""/><Buttonandroid:id="+id/suggestionsend"android:layout_width="300dp"android:layout_height="45dp"android:textSize="16sp"android:layout_below="id/whitesuggestionandroid:layout_alignParentLeft="tru
50、e"android:layout_marginLeft="10dipandroid:textColor="#1d5872"android:text="發(fā)送"/></LinearLayout>about.xml:關(guān)于點(diǎn)滴界面代碼<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http:android:layout_width="wrap_content"
51、android:layout_height="wrap_content"android:background="drawable/about"><Buttonandroid:id="+id/return_button"android:layout_width="50dp"android:layout_height="32dp"android:layout_alignParentLeft="true"android:layout_marginLeft="9
52、dp"android:layout_marginTop="9dp"android:background="drawable/return_button"/></LinearLayout>setting.xml:設(shè)置界面代碼<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http:android:orientation="vertical"android:la
53、yout_width="wrap_content"android:layout_height="wrap_content"<Buttonandroid:id="+id/return_button"android:layout_width="50dp"android:layout_height="32dp"android:layout_alignParentLeft="true"android:layout_marginLeft="9dp"androi
54、d:layout_marginTop="9dp"android:background="drawable/return_button"/><Buttonandroid:id="+id/changeaccount"android:layout_width="250dp"android:layout_height="32dp"android:layout_centerHorizontal="true"android:layout_marginTop="85d
55、p"android:background="drawable/changeaccount"/><Buttonandroid:id="+id/logout"android:layout_width="250dp"android:layout_height="32dp"android:layout_below="id/changeaccount"android:layout_centerHorizontal="true"android:layout_marg
56、inTop="20dp"android:background="drawable/logout"/></RelativeLayout>hello.java:歡迎界面(main.xml)響應(yīng)代碼packagecom.android.hello;importandroid.app.Activity;importandroid.os.Bundle;importandroid.os.Handler;importandroid.view.View;importandroid.widget.Button;importandroid.widget.E
57、ditText;importandroid.widget.Toast;importandroid.view.Gravity;importandroid.content.Intent;publicclasshelloextendsActivity/*Calledwhentheactivityisfirstcreated.*/OverridepublicvoidonCreate(BundlesavedInstanceState)super.onCreate(savedInstanceState);setContentView(R.layout.main);newHandler().postDela
58、yed(newRunnable()Overridepublicvoidrun()Intentintent=newIntent();intent.setClass(hello.this,password.class);startActivity(intent);hello.this.finish();,2500);password.java:登錄界面(password.xml)響應(yīng)代碼packagecom.android.hello;importandroid.app.Activity;importandroid.os.Bundle;importandroid.view.View;importa
59、ndroid.widget.Button;importandroid.widget.EditText;importandroid.widget.CheckBox;importandroid.widget.Toast;importandroid.widget.CompoundButton;importandroid.view.Gravity;importandroid.content.Intent;publicclasspasswordextendsActivitypublicvoidonCreate(BundlesavedInstanceState)super.onCreate(savedIn
60、stanceState);setContentView(R.layout.password);Buttonlogin=(Button)findViewById(R.id.login);login.setOnClickListener(newView.OnClickListener()publicvoidonClick(Viewv)EditTextname=(EditText)findViewById(R.);EditTextpassword=(EditText)findViewById(R.id.password);Stringentername=name.getText().t
61、oString();Stringenterpassword=password.getText().toString();if(entername.equals("abc")&&enterpassword.equals("123")Intentintent=newIntent();intent.setClass(password.this,main_menu.class);startActivity(intent);password.this.finish();elseToasttoast=Toast.makeText(getApplica
62、tionContext(),"賬號(hào)或密碼錯(cuò)誤,請(qǐng)重新輸入?!?Toast.LENGTH_LONG);toast.setGravity(Gravity.CENTER,0,0);toast.show();Intentintent=newIntent();intent.setClass(password.this,password.class);startActivity(intent);password.this.finish(););Buttonforgetpassword=(Button)findViewById(R.id.forgetpassword);forgetpassword
63、.setOnClickListener(newView.OnClickListener()(publicvoidonClick(Viewv)(Intentintent=newIntent();intent.setClass(password.this,findpassword.class);startActivity(intent););Buttoncreateid=(Button)findViewByld(R.id.createid);createid.setOnClickListener(newView.OnClickListener()(publicvoidonClick(Viewv)(
64、Intentintent=newIntent();intent.setClass(password.this,create_id.class);startActivity(intent););findpassword.java:忘記密碼界面(findpassword.xml)響應(yīng)代碼packagecom.android.hello;importandroid.app.Activity;importandroid.os.Bundle;importandroid.view.View;importandroid.widget.Button;importandroid.widget.EditText;importandroid.widget.Toast;importandroid.view.Gravity;p
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 印刷企業(yè)市場(chǎng)調(diào)研方法考核試卷
- 家庭裝飾畫框批發(fā)考核試卷
- 園藝陶瓷的公共空間裝飾效果考核試卷
- 印刷設(shè)備生產(chǎn)過程的智能化技術(shù)應(yīng)用案例考核試卷
- 圖書出租業(yè)務(wù)的服務(wù)標(biāo)準(zhǔn)化培訓(xùn)考核試卷
- 影視錄放設(shè)備的智能鏡頭切換考核試卷
- 暖氣施工合同范本
- 簽訂重大銷售合同范本
- 口腔消毒培訓(xùn)課件
- 電商行業(yè)產(chǎn)品描述免責(zé)協(xié)議承諾書
- EPC項(xiàng)目采購(gòu)管理方案
- 旅游景區(qū)旅游安全風(fēng)險(xiǎn)評(píng)估報(bào)告
- 門窗安裝工程投標(biāo)書范本(二)
- 追覓科技在線測(cè)評(píng)題
- 智鼎在線測(cè)評(píng)107題
- 病歷書寫規(guī)范與住院病歷質(zhì)量監(jiān)控管理制度
- 12詩(shī)詞四首《漁家傲-秋思》公開課一等獎(jiǎng)創(chuàng)新教學(xué)設(shè)計(jì) 初中語(yǔ)文九年級(jí)下冊(cè)
- 金礦承包協(xié)議合同2024年
- 解讀國(guó)有企業(yè)管理人員處分條例(2024)課件(全文)
- 創(chuàng)新創(chuàng)業(yè)基礎(chǔ)-理論、案例與訓(xùn)練(大學(xué)生創(chuàng)新創(chuàng)業(yè)教育課程)全套教學(xué)課件
- TD/T 1072-2022 國(guó)土調(diào)查坡度分級(jí)圖制作技術(shù)規(guī)定(正式版)
評(píng)論
0/150
提交評(píng)論