Nov
07


作者:Qiu   

XMPP: Extensible Messaging and Presence Protocol Detail: http://www.xmpp.org/可扩展消息处理现场协议, 是基于可扩展标记语言(XML)的协议,它用于即时消息(IM)以及在线现场探测。它在促进服务器之间的准即时操作。这个协议可能最终允许因特网用户向因特网上的其他任何人发送即时消息,即使其操作系统和浏览器不同。

XMPP是一个流化XML[XML]元素的协议,用于准实时的交换消息和出席信息。XMPP的核心功能定义在Extensible Messaging and Presence Protocol (XMPP): Core XMPP-CORE. 这些功能 -- 主要是 XML流, 使用 TLS和SASL,以及流的根元素之下的<message/>, <presence/>, 和 <iq/> 子元素 -- 为各种类型的准实时应用提供了一个构造基础, 它可以被放在核心的顶层,使用特定XML名字空间[XML-NAMES]发送特定的应用数据. 我很想描述XMPP核心功能的扩展和应用,时间关系及理解的不是很透彻,也不敢乱发言;XMPP核心功能提供了RFC 2779 [IMP-REQS]定义的基本的即时消息和出席信息功能。

比较好的开源代码有:mobber和Jabber,一个代码简单易懂,另外一个功能比较全;本人比较喜欢的网站是:http://www.jabber.org/,里面有好多基于各种系统的源代码,只要愿意借鉴,只管拿来就可以啦。

以下是本人在借鉴mobber和Jabber源代码的基础上开发的手机Jabber客户端部分界面:

1、登录界面

鐧诲綍鐣岄潰

2、好友列表

濂藉弸鍒楄〃

3、设置好友界面

璁剧疆濂藉弸

为了更好的了解XMPP协议,附上XMPP协议说明,可以在此基础上开发更多的客户端。

【附】XMPP协议说明
基本的jabber客户端必须实现以下标准协议(XEP-0211)
1、RFC3920 Core http://tools.ietf.org/html/rfc3920
2、RFC3921 Instant Messaging and Presence http://tools.ietf.org/html/rfc3921
3、XEP-030 Service Discovery http://www.xmpp.org/extensions/xep-0030.html
4、XEP-0115 Entity Capabilities http://www.xmpp.org/extensions/xep-0115.html

基本的jabber服务器必须实现以下标准协议(XEP-0212)
1、RFC3920 Core http://tools.ietf.org/html/rfc3920
2、RFC3921 Instant Messaging and Presence http://tools.ietf.org/html/rfc3921
3、XEP-030 Service Discovery http://www.xmpp.org/extensions/xep-0030.html

一、注册
XEP-0077 In-Band Registration http://www.xmpp.org/extensions/xep-0077.html
二、登录
XEP-0020 Software Version http://www.xmpp.org/extensions/xep-0092.html
三、好友列表
XEP-0083 Nested Roster Groups http://www.xmpp.org/extensions/xep-0083.html
1、获取好友列表
2、存储好友列表
XEP-0049 Private XML Storage http://www.xmpp.org/extensions/xep-0049.html
3、备注好友信息
XEP-0145 Annotations http://www.xmpp.org/extensions/xep-0145.html
4、存储书签
XEP-0048 Bookmark Storage http://www.xmpp.org/extensions/xep-0048.html
5、好友头像
XEP-0008 IQ-Based Avatars http://www.xmpp.org/extensions/xep-0008.html
XEP-0084 User Avatar http://www.xmpp.org/extensions/xep-0084.html
XEP-0054 vcard-temp http://www.xmpp.org/extensions/xep-0054.html
四、用户状态
RFC-3921 Subscription States http://www.ietf.org/rfc/rfc3921.txt
五、文本消息
1、在线消息
2、离线消息
XEP-0013 Flexible Offline Message Retrieval http://www.xmpp.org/extensions/xep-0013.html
XEP-0160 Best Practices for Handling Offline Messages http://www.xmpp.org/extensions/xep-0160.html
XEP-0203 Delayed Delivery http://www.xmpp.org/extensions/xep-0203.html
3、聊天状态通知
XEP-0085 Chat State Notifications http://www.xmpp.org/extensions/xep-0085.html
六、群组聊天
1、XEP-0045 Multi-User Chat http://www.xmpp.org/extensions/xep-0045.html
七、文件传输
1、XEP-0095 Stream Initiation http://www.xmpp.org/extensions/xep-0095.html
2、XEP-0096 File Transfer http://www.xmpp.org/extensions/xep-0096.html
3、XEP-0065 SOCKS5 Bytestreams http://www.xmpp.org/extensions/xep-0065.html
4、XEP-0215 STUN Server Discovery for Jingle http://www.xmpp.org/extensions/xep-0215.html
5、RFC-3489 STUN http://tools.ietf.org/html/rfc3489

八、音视频会议
1、XEP-0166 Jingle http://www.xmpp.org/extensions/xep-0166.html#negotiation
2、XEP-0167 Jingle Audio via RTP http://www.xmpp.org/extensions/xep-0167.html
3、XEP-0176 Jingle ICE Transport http://www.xmpp.org/extensions/xep-0176.html
4、XEP-0180 Jingle Video via RTP http://www.xmpp.org/extensions/xep-0180.html#negotiation
5、XEP-0215 STUN Server Discovery for Jingle http://www.xmpp.org/extensions/xep-0215.html
6、RFC-3489 STUN http://tools.ietf.org/html/rfc3489

九、用户查询
XEP-0055 Jabber Search http://www.xmpp.org/extensions/xep-0055.html

整体:
一、协议数据交互
XEP-0004 Data Forms http://www.xmpp.org/extensions/xep-0004.html
二、jabber-RPC
XEP-0009 Jabber-RPC http://www.xmpp.org/extensions/xep-0009.html
三、功能协商
XEP-0020 Feature Negotiation http://www.xmpp.org/extensions/xep-0020.html
四、服务发现
XEP-0030 Service Discovery http://www.xmpp.org/extensions/xep-0030.html
五、会话建立
XEP-0116 Encrypted Session Negotiation http://www.xmpp.org/extensions/xep-0116.html
XEP-0155 Stanza Session Negotiation http://www.xmpp.org/extensions/xep-0155.html
XEP-0201 Best Practices for Message Threads http://www.xmpp.org/extensions/xep-0201.html

您必须登录 才能进行评论。

得到OpenID
使用OpenID提供商
35OpenID 35OpenID MyOpenID MyOpenID Flickr Flickr
Google Google Yahoo Yahoo! AOL AOL
Blogger Blogger LiveJournal LiveJournal Verisign Verisign
ClaimID ClaimID Technorati Technorati Vidoop Vidoop
OpenID OpenID 帮助
您还没有登录,请登录后继续操作。
提示:您必需打开Cookie才能使用本系统
请输入您的 OpenID OpenID 登录:
例如:http://yourname.openid.35.com
close