没有合适的资源?快使用搜索试试~ 我知道了~
基于java的android即时通讯软件毕业设计.doc
0 下载量 146 浏览量
2023-07-10
12:44:44
上传
评论
收藏 649KB DOC 举报
温馨提示
试读
32页
基于java的android即时通讯软件毕业设计.doc
资源推荐
资源详情
资源评论
毕业论文(毕业设计)
题目:android 即时通讯软件
系 院: XXXXX
学生姓名:XX
学 号: XXX
专 业:计算机科学与技术
年 级: 计本 0902 班
完成日期: XXX
指导教师:XXXXX
- 1 -
摘 要
在网络越来越发达的今天,人们对网络的依赖越来越多,越来越离不开网络,
由此而产生的聊天工具越来越多,例如,国外的 ICQ、国内腾讯公司开发的
OICQ。基于 Java 网络编程的强大功能,本次毕业设计使用 Java 编写一个运行在
android2.2 版本以上的即时通讯软件。
一般来说,聊天工具大多数由客户端程序和服务器程序外加服务器端用于存
放客户数据的数据库组成,本系统采用客户端/服务器架构模式通过 Java 提供的
Socket 类来连接客户机和服务器并使客户端和服务器之间相互通信,由于聊天
是多点对多点的,Java 提供的多线程功能用多线程可完成多点对多点的聊天,
数据库管理系统用 MYSQL 完成并通过 ADO.Net 访问数据库。
本系统建立在 JAVA 平台上,系统的设计使用了面向对象技术和面向对象的
设计原则。系统采用 C/S 结构,客户端与客户端以及客户端与服务器端之间通过
Socket 传送消息。使用 JAVA 语言编写,开发工具采用 Eclipse。服务器端设计
与实现过程中,采用了多线程技术,可以在单个程序当中同时运行多个不同的线
程,执行不同的任务。大大增强了程序对服务器资源的利用。
即时通讯系统完成后将可进行多人对多人的聊天,对好友进行查找和添加,
对新用户的注册,发送消息、接受消息等等功能。
关键字:多线程 ;客户机/服务器 ;JAVA ; Socket ; Eclipse ; TCP/IP
- 2 -
Abstract
as the network become more and more developed, people become more and more lean
to the network, and can not leave with out it. This caused the chat materials become
more numerous, as the overseas ICQ system, the OICQ system that invented by
Tencent Co., and so on. So we create a network chat medium just like the QQ. Java
network programming based on the power, the use of Java designed to prepare
graduates a chat system.
In general, the majority of the chat tool for client and server program in
addition to server-side storage of customer data for the database, the system uses a
client / server architecture model the adoption of Java provided Socket class connect
client and server and between the client and server communicate with each other, as
the chat is to provide point-to-multipoint and multi-threaded Java function to be
completed by using multi-threaded chat and more point-to-multipoint, database
management system with MYSQL the completion and adoption of JDBC-ODBC Bridge
access the database.
The system built on the JAVA platform, the system design using
object-oriented technology and object-oriented design principles. System uses the C /
S structure, client and client-side and server-side client and send messages through
Socket. The use of JAVA language, development tools using Eclipse. Design and
Implementation of server-side process, the use of multi-threading technology, which
can process in a single run at the same time a number of different threads, the
implementation of different tasks. Procedures greatly enhanced the use of server
resources.
Chat system will allow people to complete chat to more friends,and the system
can search and add,can deal with new user registration, send messages, receive
messages and so on.
Keywords : Multithreading ; Client/Server ;JAVA ;Socket ;Eclipse ;TCP/IP
- 3 -
目 录
1 绪论 ............................................................................................................................................1
1.1 国内外聊天系统的研究现状 .......................................................................1
1.2 JAVA 语言 ......................................................................................................2
1.2.1 Java 的发展历史.....................................................................................2
1.2.2 Java 的特点.............................................................................................3
1.2.3 Java 与 Internet .......................................................................................4
1.3 SOCKET 编程..................................................................................................4
1.3.1 关于 TCP/IP 协议..................................................................................4
1.3.2 服务器和客户机....................................................................................5
1.4 本文内容安排 ...............................................................................................6
2 需求分析...................................................................................................................................7
2.1 可行性研究...................................................................................................7
2.1.1 可行性分析............................................................................................7
2.1.2 系统功能需求.........................................................................................7
2.1.3 系统性能需求........................................................................................8
2.1.4 系统运行需求......................................................................................8
2.2 数据流图.......................................................................................................8
2.2.1 顶层数据流图........................................................................................8
2.2.2 一层数据流图......................................................................................9
2.2.3 二层数据流图......................................................................................9
3 概要设计.................................................................................................................................11
3.1 系统实现原理 .............................................................................................11
3.2 系统实现层次图: ...................................................................................12
3.3 各模块详细功能 .........................................................................................12
3.3.2 服务器端结构.......................................................................................12
3.3.2 客户端结构..........................................................................................14
4 详细设计.................................................................................................................................19
4.1 系统流程图.................................................................................................19
4.1.1 系统总体流程图..................................................................................19
4.1.2 系统客户端流程图............................................................................20
4.2 编写服务器端程序.....................................................................................20
4.2.1 问题陈述..............................................................................................20
4.2.2 解决方案............................................................................................21
4.3 客户端程序编写............................................................................................................28
4.3.3 聊天室..................................................................................................38
参考文献......................................................................................................................................46
致谢 ...............................................................................................................................................45
- 4 -
1 绪论
1.1 国内外即时通讯系统的研究现状
目前国内外做即时通讯软件的公司很多,产品也琳琅满目,国内有诸如腾讯
QQ、新浪 UC、网易泡泡等,国外有著名的 MSN(新版改名为 Live Messenger)
以及跨平台 Gaim 等。本人取最具代表性的 QQ 和 MSN 进行了一些研究,作为
我开发即时通讯的准备。
腾讯无疑是国内即时通讯市场的霸主,自从 99 年进入即时通讯领域并迅速
占市场之后,其在国内用户数量始终高居榜首,即使近几年面对微软 MSN 的强
大攻势,腾讯 QQ 的时常占有率依然稳步增长。腾讯的成功与其对 QQ 的不断创
新和完善是分不开的。
参考了许多网络上的资料,以及自己通过观察腾讯 QQ 运行时的各种细节。
可以确定腾讯 QQ 是以多服务器提供服务、服务器总控客户端、客户端之间 UDP
直连通信的。并且在两个客户端之间不能建立直连的情况下,才由服务器进行中
转通信。
其模型如图 1-1
图 1-1 腾讯 QQ 服务器-客户端模型 1
与腾讯 QQ 不同,微软的 MSN Messenger 只使用了 TCP 作为传输层通
信协议,所有客户端与服务器进行连接,然后通过与服务器的 TCP 连接进行中
转通信。
剩余31页未读,继续阅读
资源评论
黑色的迷迭香
- 粉丝: 718
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功