本科毕业设计(论文)简易手机网络聊天室(客户端)学院信息工程学院专业信息工程(电子信息工程方向)年级班别学号学生姓名指导教师2014年5月30日简易手机网络聊天室(客户端)信息工程学院叶戈信息工程学院学院信息工程学院一院摘要本系统设计的是一个简易的Android手机网络聊天室,该聊天室采用Socket套接字进行网络通讯,用户可以及时互通信息,交流思想。本系统主要是采用了C/S(Client/Server,客户机/服务器)模式所开发的。手机作为客户端,能够实现注册,登陆,聊天(包括文字聊天以及表情聊天)等功能。而电脑作为服务端,链接MySQL小型数据库,储存用户的基本信息,接收来自客户端的不同指令,从而实现数据的传递。本文首先对设计一个聊天室的背景进行了分析,另外再对国内外比较流行的几款即时聊天软件进行了简单的介绍,确定了毕业设计的主要工作,开发一个在局域网内可以聊天的简易手机聊天室。为了实现聊天室的功能,首先介绍了该项目涉及到的一些技术背景,包括TCP/IP协议,Socket“套接字”的基本机制以及需要使用的一个Serializable接口,来实现序列化与反序列化。之后对实现该系统的可行性与该系统的总体架构进行了分析,在此基础上,对整个系统进行模块划分以及对每个模块功能的实现进行了具体的设计。关键词:Android,Socket套接字,C/S模式,MySQL,Serializable注:本设计(论文)题目来源于自选题目。AbstractThissystemisdesignedasasimpleandroidmobilenetworkchatroom,whichusesthesockettoachievenetworkcommunication,userscanachieveinformationshareandcommunicatingintime.ThissystemmainlyadoptedC/S(Client/Server)mode.Mobileasclient,canimplementitsfunctionalitylikeregistration,loginandchatwithotherclients.Whilecomputerasserver,itwilllinkMySQLminidatabase,keepusers’informationinitsmemory,receivedifferentordersfromclientthusrealizethedeliveryofdata.Thistextfirstlyintroducedthebackgroundtodesignachatroom,thenmakesummaryofcurrentinternationalanddemoticinstantmessagingservice,inthiscaseconfirmedmymaintaskofmygraduationproject:tocreateasimplechatroonwhichcanachievecommunicatingunderlocalareanetwork.Toachievechatroom’sfunction,firstlyintroducedreferringtechnicalbackground,includingTCP/IPagreement,Socket’sbasicsystemandtheSerializableconnectorwhichisnecessarytoSocket,inordertoimplementserializationanddeserialization.AfterImadeaanalysisofthissystem’sfeasibilityandoverallstructure.Basedonthiscomesoutthemoduledivisionofthewholesystemanddetaileddesigntoachieveeverymodule’sfunction.Keywords:Android,Socket,C/Smold,MySQL,Serializable目录1绪论...........................................................................................................................................................11.1聊天室的设计背景..................................................................................................................11.2国内外常用的聊天软件..........................................................................................................11.3论文的主要工作.......................................................................................................................21.4论文的结构...............................................................................................................................22聊天室的技术背景...............................................................................................................................32.1TCP/IP简介...............................................................................................................................32.2Socket的基本机制....................................................................................................................32.3Serializable简介........................................................................................................................42.4BroadcastReceiver简介............................................................................................................53系统分析..................................................................................................................................................73.1聊天室可行性的分析..............................................................................................................73.2系统的总体架构.......................................................................................................................74聊天室的设计与实现...........................................................................................................................94.1聊天室的总体概述..................................................................................................................94.2客户端的设计与实现..............................................................................................................94.2.1登陆模块.................................................................................................................104.2.2注册模块.................................................................................................................144.2.3聊天模块.................................................................................................................164.3服务端的设计.........................................................................................................................204.3.1服务端的说明.........................................................................................................204.3.2详细设计与实现.....................................................................................................204.3.3MySQL的应用........................................................................................................235系统的测试...........................................................................................................................................26总结..........................................................................................................