一、实现功能
1.登录
2.私聊
3.抖动窗口
4.视频
二、流程图
[img]http://dl.iteye.com/upload/attachment/431839/5ec5b0bf-b674-3d89-bfbe-71763ee7b94d.jpg[/img]
三、自定义通信协议xmpp
1------>客户端与服务器连接
a.没有连接上则返回超时,
b.连接上 密码错误则进行提示
正确则返回个人信息、用户列表并进入用户窗口
1-1 . 登录请求
<msg>
<type>login</type>
<account>账号</account>
<pwd>密码</pwd>
</msg>
1-2 . 登录应答
<msg>
<type>login_response</type>
<state>1表示成功,0表示失败</state>
</msg>
1-3 . 发送个人信息
<msg><type>user</type><name>用户名</name><account>用户账号</account><picture>用户头像</picture></msg>
1-4 . 发送好友队列信息---默认2个组
<msg>
<type>好友类型</type>
<name>好友名</name>
<account>好友账号</account>
<picture>好友头像</picture>
</msg>
2 . 聊天
彼此在线,好友发送消息过来时,弹出对应的聊天框
2-1. <msg>
<type>chat</type>
<myaccount>本人账号</myaccount>
<friendaccount>朋友账号</friendaccount>
<content>内容</content>
</msg>
对方不在线时,给发送者提示
2-2. <msg>
<type>line</type>
<state>-1</state>
<friendaccount>不在线好友账号</friendaccount>
</msg>
3 . 抖动
点击抖动按钮则可以让对方的聊天框出现一段时间的抖动,条件是该好友要在线
3-1. <msg>
<type>shake</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
</msg>
4. 视频
4-1 视频请求(点击开始视频按钮)
<msg>
<type>vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
4-2 视频应答(点击接受按钮)
<msg>
<type>r_vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
四、界面图
1,登录
[img]http://dl.iteye.com/upload/attachment/431883/2812b358-5efd-3893-86e9-081c3d485c3d.jpg[/img]
2,用户界面
[img]http://dl.iteye.com/upload/attachment/431862/c0897112-3ff8-366e-a056-1b2b48b48c78.jpg[/img]
3,聊天界面
[img]http://dl.iteye.com/upload/attachment/431892/bff47e94-132c-3239-8b63-45f1e18011b4.jpg[/img]
4,服务器界面
[img]http://dl.iteye.com/upload/attachment/431885/f3b78200-a378-344a-9d3a-5b3b15a314de.jpg[/img]
1.登录
2.私聊
3.抖动窗口
4.视频
二、流程图
[img]http://dl.iteye.com/upload/attachment/431839/5ec5b0bf-b674-3d89-bfbe-71763ee7b94d.jpg[/img]
三、自定义通信协议xmpp
1------>客户端与服务器连接
a.没有连接上则返回超时,
b.连接上 密码错误则进行提示
正确则返回个人信息、用户列表并进入用户窗口
1-1 . 登录请求
<msg>
<type>login</type>
<account>账号</account>
<pwd>密码</pwd>
</msg>
1-2 . 登录应答
<msg>
<type>login_response</type>
<state>1表示成功,0表示失败</state>
</msg>
1-3 . 发送个人信息
<msg><type>user</type><name>用户名</name><account>用户账号</account><picture>用户头像</picture></msg>
1-4 . 发送好友队列信息---默认2个组
<msg>
<type>好友类型</type>
<name>好友名</name>
<account>好友账号</account>
<picture>好友头像</picture>
</msg>
2 . 聊天
彼此在线,好友发送消息过来时,弹出对应的聊天框
2-1. <msg>
<type>chat</type>
<myaccount>本人账号</myaccount>
<friendaccount>朋友账号</friendaccount>
<content>内容</content>
</msg>
对方不在线时,给发送者提示
2-2. <msg>
<type>line</type>
<state>-1</state>
<friendaccount>不在线好友账号</friendaccount>
</msg>
3 . 抖动
点击抖动按钮则可以让对方的聊天框出现一段时间的抖动,条件是该好友要在线
3-1. <msg>
<type>shake</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
</msg>
4. 视频
4-1 视频请求(点击开始视频按钮)
<msg>
<type>vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
4-2 视频应答(点击接受按钮)
<msg>
<type>r_vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
四、界面图
1,登录
[img]http://dl.iteye.com/upload/attachment/431883/2812b358-5efd-3893-86e9-081c3d485c3d.jpg[/img]
2,用户界面
[img]http://dl.iteye.com/upload/attachment/431862/c0897112-3ff8-366e-a056-1b2b48b48c78.jpg[/img]
3,聊天界面
[img]http://dl.iteye.com/upload/attachment/431892/bff47e94-132c-3239-8b63-45f1e18011b4.jpg[/img]
4,服务器界面
[img]http://dl.iteye.com/upload/attachment/431885/f3b78200-a378-344a-9d3a-5b3b15a314de.jpg[/img]
930

被折叠的 条评论
为什么被折叠?



