实例介绍
注意:之前上传的同类资源1.0、1.1、1.2、1.3版本有一些小问题,现在上传修改后的最新版本,各位请注意下载最新版的,主界面的ip地址和port端口号是我的一个服务器上的地址,可以正常连接 一、端点连接机制:基于客户端到服务器端的socket连接,在服务器端利用android系统提供的线程池处理用户的并发访问。 二、消息发送原理:在服务器端缓存所有当前在线用户,对于接收到的文字消息或语音消息循环发送到所有在线客户端。 三、消息发送格式:对于所有的发送消息,都包含一条标识行,用来标识该消息的类型(注册、登录、退出、普通消息、语音消息)。对于网络字节数据流,采用length+
【实例截图】
【核心代码】
auo7iv
└── 新建文件夹
├── chatRoom.apk
├── 客户端
│ └── chatRoom
│ ├── AndroidManifest.xml
│ ├── bin
│ │ ├── chatRoom.apk
│ │ ├── classes.dex
│ │ ├── com
│ │ │ └── csu
│ │ │ ├── adapter
│ │ │ │ ├── ChatMsgViewAdapter$1.class
│ │ │ │ ├── ChatMsgViewAdapter$2$1.class
│ │ │ │ ├── ChatMsgViewAdapter$2.class
│ │ │ │ ├── ChatMsgViewAdapter$3.class
│ │ │ │ ├── ChatMsgViewAdapter$RecordTimeTask.class
│ │ │ │ ├── ChatMsgViewAdapter$ViewHolder.class
│ │ │ │ ├── ChatMsgViewAdapter.class
│ │ │ │ ├── ExpressionGvAdapter$ViewHolder.class
│ │ │ │ └── ExpressionGvAdapter.class
│ │ │ ├── bean
│ │ │ │ ├── Message.class
│ │ │ │ └── User.class
│ │ │ ├── chatroom
│ │ │ │ ├── Appstart$1.class
│ │ │ │ ├── Appstart.class
│ │ │ │ ├── ChatActivity$10.class
│ │ │ │ ├── ChatActivity$1.class
│ │ │ │ ├── ChatActivity$2.class
│ │ │ │ ├── ChatActivity$3.class
│ │ │ │ ├── ChatActivity$4.class
│ │ │ │ ├── ChatActivity$5$1.class
│ │ │ │ ├── ChatActivity$5.class
│ │ │ │ ├── ChatActivity$6.class
│ │ │ │ ├── ChatActivity$7.class
│ │ │ │ ├── ChatActivity$8.class
│ │ │ │ ├── ChatActivity$9.class
│ │ │ │ ├── ChatActivity$MyOnTouchListener.class
│ │ │ │ ├── ChatActivity$MyPageChangeListener.class
│ │ │ │ ├── ChatActivity$MyRecordTouchListener$1.class
│ │ │ │ ├── ChatActivity$MyRecordTouchListener.class
│ │ │ │ ├── ChatActivity$RecordPlayConnection.class
│ │ │ │ ├── ChatActivity$RecordThread.class
│ │ │ │ ├── ChatActivity$SendBtnClickListener.class
│ │ │ │ ├── ChatActivity.class
│ │ │ │ ├── R$anim.class
│ │ │ │ ├── R$attr.class
│ │ │ │ ├── R$color.class
│ │ │ │ ├── R$drawable.class
│ │ │ │ ├── R$id.class
│ │ │ │ ├── R$layout.class
│ │ │ │ ├── R$raw.class
│ │ │ │ ├── R$string.class
│ │ │ │ ├── R$style.class
│ │ │ │ ├── R.class
│ │ │ │ ├── UserLoginActivity$1.class
│ │ │ │ ├── UserLoginActivity$2.class
│ │ │ │ ├── UserLoginActivity$SpinnerItemClickListner.class
│ │ │ │ ├── UserLoginActivity$SpinnerNameAdapter.class
│ │ │ │ ├── UserLoginActivity$ViewHolder.class
│ │ │ │ ├── UserLoginActivity.class
│ │ │ │ ├── UserRegisActivity$1.class
│ │ │ │ ├── UserRegisActivity$2.class
│ │ │ │ ├── UserRegisActivity.class
│ │ │ │ └── WelcomeActivity.class
│ │ │ ├── constant
│ │ │ │ └── ContentFlag.class
│ │ │ ├── db
│ │ │ │ ├── MessageDbHelper$MessageColumns.class
│ │ │ │ ├── MessageDbHelper.class
│ │ │ │ ├── UserDbHelper$UserColumns.class
│ │ │ │ └── UserDbHelper.class
│ │ │ ├── impl
│ │ │ │ ├── IhandleMessge.class
│ │ │ │ └── IRecordPlay.class
│ │ │ ├── service
│ │ │ │ ├── MessageService.class
│ │ │ │ ├── RecordPlayService$PlayBinder$1.class
│ │ │ │ ├── RecordPlayService$PlayBinder.class
│ │ │ │ ├── RecordPlayService.class
│ │ │ │ ├── RegisterService.class
│ │ │ │ └── UserService.class
│ │ │ ├── test
│ │ │ │ └── chatTest.class
│ │ │ ├── thread
│ │ │ │ └── RecordPlayThread.class
│ │ │ └── tool
│ │ │ ├── ExpressionUtil.class
│ │ │ ├── FileDealTool.class
│ │ │ ├── StreamTool.class
│ │ │ └── SystemConstant.class
│ │ └── resources.ap_
│ ├── default.properties
│ ├── gen
│ │ └── com
│ │ └── csu
│ │ └── chatroom
│ │ └── R.java
│ ├── libs
│ │ └── android-support-v4.jar
│ ├── res
│ │ ├── anim
│ │ │ ├── popu_enter.xml
│ │ │ └── popu_out.xml
│ │ ├── drawable
│ │ │ ├── btn_intercom.xml
│ │ │ ├── btn_intercon.xml
│ │ │ ├── btn_keyboard.xml
│ │ │ ├── btn_pressed.xml
│ │ │ ├── btn_press_voice.xml
│ │ │ ├── btn_style_alert_dialog_cancel.xml
│ │ │ ├── btn_style_alert_dialog_special.xml
│ │ │ ├── btn_style_green.xml
│ │ │ ├── btn_style_white.xml
│ │ │ ├── chat_date.xml
│ │ │ ├── chat_expression_bg.xml
│ │ │ ├── chatfrom_bg.xml
│ │ │ ├── chatfrom_voice_play_frame.xml
│ │ │ ├── chatto_bg.xml
│ │ │ ├── chatto_voice_play_frame.xml
│ │ │ ├── express_item.xml
│ │ │ ├── loginbg.xml
│ │ │ ├── progressbar.xml
│ │ │ ├── record_level_list.xml
│ │ │ ├── shape_dialog.xml
│ │ │ ├── titlebg.xml
│ │ │ ├── title_btn_back.xml
│ │ │ ├── title_btn_right.xml
│ │ │ └── tv_operate_bg.xml
│ │ ├── drawable-hdpi
│ │ │ ├── bg_button.9.png
│ │ │ ├── btn_style_alert_dialog_button_normal.9.png
│ │ │ ├── btn_style_alert_dialog_button_pressed.9.png
│ │ │ ├── btn_style_alert_dialog_cancel_normal.9.png
│ │ │ ├── btn_style_alert_dialog_special_normal.9.png
│ │ │ ├── btn_style_alert_dialog_special_pressed.9.png
│ │ │ ├── btn_style_one_disabled.9.png
│ │ │ ├── btn_style_one_focused.9.png
│ │ │ ├── btn_style_one_normal.9.png
│ │ │ ├── btn_style_one_pressed.9.png
│ │ │ ├── btn_style_two_focused.9.png
│ │ │ ├── btn_style_two_normal.9.png
│ │ │ ├── btn_style_two_pressed.9.png
│ │ │ ├── chatfrom_bg_focused.9.png
│ │ │ ├── chatfrom_bg_normal.9.png
│ │ │ ├── chatfrom_bg_pressed.9.png
│ │ │ ├── chatfrom_voice_playing_f1.png
│ │ │ ├── chatfrom_voice_playing_f2.png
│ │ │ ├── chatfrom_voice_playing_f3.png
│ │ │ ├── chatfrom_voice_playing.png
│ │ │ ├── chat_icon_smiles.png
│ │ │ ├── chat_icon_smiles_pressed.png
│ │ │ ├── chat_recorder.png
│ │ │ ├── chatting_setmode_biaoqing_btn_normal.png
│ │ │ ├── chatting_setmode_keyboard_btn_focused.png
│ │ │ ├── chatting_setmode_keyboard_btn_normal.png
│ │ │ ├── chatting_setmode_keyboard_btn_pressed.png
│ │ │ ├── chatting_setmode_voice_btn_focused.png
│ │ │ ├── chatting_setmode_voice_btn_normal.png
│ │ │ ├── chatting_setmode_voice_btn_pressed.png
│ │ │ ├── chatto_bg_focused.9.png
│ │ │ ├── chatto_bg_normal.9.png
│ │ │ ├── chatto_bg_pressed.9.png
│ │ │ ├── chatto_voice_playing_f1.png
│ │ │ ├── chatto_voice_playing_f2.png
│ │ │ ├── chatto_voice_playing_f3.png
│ │ │ ├── chatto_voice_playing.png
│ │ │ ├── confirm_dialog_bg2.9.png
│ │ │ ├── copyright.png
│ │ │ ├── d1.png
│ │ │ ├── d2.png
│ │ │ ├── f000.gif
│ │ │ ├── f001.gif
│ │ │ ├── f002.gif
│ │ │ ├── f003.gif
│ │ │ ├── f004.gif
│ │ │ ├── f005.gif
│ │ │ ├── f006.gif
│ │ │ ├── f007.gif
│ │ │ ├── f008.gif
│ │ │ ├── f009.gif
│ │ │ ├── f010.gif
│ │ │ ├── f011.gif
│ │ │ ├── f012.gif
│ │ │ ├── f013.gif
│ │ │ ├── f014.gif
│ │ │ ├── f015.gif
│ │ │ ├── f016.gif
│ │ │ ├── f017.gif
│ │ │ ├── f018.gif
│ │ │ ├── f019.gif
│ │ │ ├── f020.gif
│ │ │ ├── f021.gif
│ │ │ ├── f022.gif
│ │ │ ├── f023.gif
│ │ │ ├── f024.gif
│ │ │ ├── f025.gif
│ │ │ ├── f026.gif
│ │ │ ├── f027.gif
│ │ │ ├── f028.gif
│ │ │ ├── f029.gif
│ │ │ ├── f030.gif
│ │ │ ├── f031.gif
│ │ │ ├── f032.gif
│ │ │ ├── f033.gif
│ │ │ ├── f034.gif
│ │ │ ├── f035.gif
│ │ │ ├── f036.gif
│ │ │ ├── f037.gif
│ │ │ ├── f038.gif
│ │ │ ├── f039.gif
│ │ │ ├── f040.gif
│ │ │ ├── f041.gif
│ │ │ ├── f042.gif
│ │ │ ├── f043.gif
│ │ │ ├── f044.gif
│ │ │ ├── f045.gif
│ │ │ ├── f046.gif
│ │ │ ├── f047.gif
│ │ │ ├── f048.gif
│ │ │ ├── f049.gif
│ │ │ ├── f050.gif
│ │ │ ├── f051.gif
│ │ │ ├── f052.gif
│ │ │ ├── f053.gif
│ │ │ ├── f054.gif
│ │ │ ├── f055.gif
│ │ │ ├── f056.gif
│ │ │ ├── f057.gif
│ │ │ ├── f058.gif
│ │ │ ├── f059.gif
│ │ │ ├── f060.gif
│ │ │ ├── f061.gif
│ │ │ ├── f062.gif
│ │ │ ├── f063.gif
│ │ │ ├── f064.gif
│ │ │ ├── f065.gif
│ │ │ ├── f066.gif
│ │ │ ├── f067.gif
│ │ │ ├── f068.gif
│ │ │ ├── f069.gif
│ │ │ ├── f070.gif
│ │ │ ├── f071.gif
│ │ │ ├── f072.gif
│ │ │ ├── f073.gif
│ │ │ ├── f074.gif
│ │ │ ├── f075.gif
│ │ │ ├── f076.gif
│ │ │ ├── f077.gif
│ │ │ ├── f078.gif
│ │ │ ├── f079.gif
│ │ │ ├── f080.gif
│ │ │ ├── f081.gif
│ │ │ ├── f082.gif
│ │ │ ├── f083.gif
│ │ │ ├── f084.gif
│ │ │ ├── f085.gif
│ │ │ ├── f086.gif
│ │ │ ├── f087.gif
│ │ │ ├── f088.gif
│ │ │ ├── f089.gif
│ │ │ ├── f090.gif
│ │ │ ├── f091.gif
│ │ │ ├── f092.gif
│ │ │ ├── f093.gif
│ │ │ ├── f094.gif
│ │ │ ├── f095.gif
│ │ │ ├── f096.gif
│ │ │ ├── f097.gif
│ │ │ ├── f098.gif
│ │ │ ├── f099.gif
│ │ │ ├── f100.gif
│ │ │ ├── f101.gif
│ │ │ ├── f102.gif
│ │ │ ├── f103.gif
│ │ │ ├── f104.gif
│ │ │ ├── f105.gif
│ │ │ ├── f106.gif
│ │ │ ├── guest_bg.jpg
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon.png
│ │ │ ├── intercom_dispress.png
│ │ │ ├── intercom.png
│ │ │ ├── mm_title_back_focused.9.png
│ │ │ ├── mm_title_back_normal.9.png
│ │ │ ├── mm_title_back_pressed.9.png
│ │ │ ├── mm_title_btn_focused.9.png
│ │ │ ├── mm_title_btn_normal.9.png
│ │ │ ├── mm_title_btn_pressed.9.png
│ │ │ ├── normal_button.9.png
│ │ │ ├── normal_button_blue.9.png
│ │ │ ├── normal_button_pressed.9.png
│ │ │ ├── record_me_normal.png
│ │ │ ├── record_other_normal.png
│ │ │ ├── title_bar.9.png
│ │ │ ├── title_function_bg.9.png
│ │ │ ├── voicesearch_feedback001.png
│ │ │ ├── voicesearch_feedback002.png
│ │ │ ├── voicesearch_feedback003.png
│ │ │ ├── voicesearch_feedback004.png
│ │ │ ├── voicesearch_feedback005.png
│ │ │ ├── voicesearch_feedback006.png
│ │ │ ├── voicesearch_feedback007.png
│ │ │ └── widget_message_bless_bgnormal.9.png
│ │ ├── drawable-mdpi
│ │ │ ├── drawable-ldpi
│ │ │ │ └── icon.png
│ │ │ └── icon.png
│ │ ├── layout
│ │ │ ├── appstart.xml
│ │ │ ├── chat_item_left.xml
│ │ │ ├── chat_item_right.xml
│ │ │ ├── dialog_layout.xml
│ │ │ ├── exit_dialog.xml
│ │ │ ├── express_gv.xml
│ │ │ ├── express_item.xml
│ │ │ ├── login_title.xml
│ │ │ ├── login.xml
│ │ │ ├── main.xml
│ │ │ ├── popu_convert.xml
│ │ │ ├── popu_option.xml
│ │ │ ├── popu_record.xml
│ │ │ ├── popu.xml
│ │ │ ├── record_dialog.xml
│ │ │ ├── record_send_dialog.xml
│ │ │ ├── register.xml
│ │ │ ├── regis_title.xml
│ │ │ ├── spinner_item.xml
│ │ │ ├── spinner.xml
│ │ │ ├── title.xml
│ │ │ └── welcome.xml
│ │ ├── raw
│ │ │ ├── play_completed.mp3
│ │ │ └── voip_ring.mp3
│ │ └── values
│ │ ├── bgstyle.xml
│ │ ├── color.xml
│ │ ├── popustyle.xml
│ │ └── strings.xml
│ └── src
│ └── com
│ └── csu
│ ├── adapter
│ │ ├── ChatMsgViewAdapter.java
│ │ └── ExpressionGvAdapter.java
│ ├── bean
│ │ ├── Message.java
│ │ └── User.java
│ ├── chatroom
│ │ ├── Appstart.java
│ │ ├── ChatActivity.java
│ │ ├── UserLoginActivity.java
│ │ ├── UserRegisActivity.java
│ │ └── WelcomeActivity.java
│ ├── constant
│ │ └── ContentFlag.java
│ ├── db
│ │ ├── MessageDbHelper.java
│ │ └── UserDbHelper.java
│ ├── impl
│ │ ├── IhandleMessge.java
│ │ └── IRecordPlay.java
│ ├── service
│ │ ├── MessageService.java
│ │ ├── RecordPlayService.java
│ │ ├── RegisterService.java
│ │ └── UserService.java
│ ├── test
│ │ └── chatTest.java
│ ├── thread
│ │ └── RecordPlayThread.java
│ └── tool
│ ├── ExpressionUtil.java
│ ├── FileDealTool.java
│ ├── StreamTool.java
│ └── SystemConstant.java
└── 服务器端
└── chatMessageServer
├── bin
│ └── com
│ └── csu
│ ├── bean
│ │ ├── Message.class
│ │ └── User.class
│ ├── client
│ │ ├── ServerWindow$1.class
│ │ └── ServerWindow.class
│ ├── constant
│ │ └── ContentFlag.class
│ ├── server
│ │ ├── ChatServer$1.class
│ │ ├── ChatServer$SocketTask.class
│ │ └── ChatServer.class
│ └── tool
│ ├── FormatDate.class
│ ├── StreamTool.class
│ └── XmlParser.class
├── image
│ ├── 1373529466171.png
│ ├── 1373593346750.png
│ ├── 1373596376484.png
│ ├── 1373596759109.png
│ ├── 1373875140828.png
│ ├── 1373936773343.png
│ ├── 1374045439734.png
│ ├── 1374218826234.png
│ ├── 1379084799468.png
│ ├── 1381157660468.png
│ ├── 1381196714515.png
│ ├── 1381197211718.png
│ ├── 1381199362703.png
│ ├── 1381203269843.png
│ ├── 1381203300531.png
│ ├── 1381203390312.png
│ ├── 1381203458687.png
│ ├── 1381203597031.png
│ ├── 1381739814062.png
│ ├── 1381741808343.png
│ └── 1381742131406.png
├── lib
│ ├── commons-beanutils.jar
│ ├── commons-collections-3.2.1.jar
│ ├── commons-lang-2.2.jar
│ ├── commons-logging.jar
│ ├── ezmorph-1.0.6.jar
│ ├── jdom.jar
│ ├── json.jar
│ └── json-lib-2.2.3-jdk15.jar
├── loginUser.xml
└── src
└── com
└── csu
├── bean
│ ├── Message.java
│ └── User.java
├── client
│ └── ServerWindow.java
├── constant
│ └── ContentFlag.java
├── server
│ └── ChatServer.java
└── tool
├── FormatDate.java
├── StreamTool.java
└── XmlParser.java
63 directories, 382 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论