http://wangruwei.blog.51cto.com/186868/47633
XMPP: Extensible Messaging and Presence Protocol Detail: [url]http://www.xmpp.org/[/url]可扩展消息处理现场协议, 是基于可扩展标记语言(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,一个代码简单易懂,另外一个功能比较全;本人比较喜欢的网站是: [url]http://www.jabber.org/[/url],里面有好多基于各种系统的源代码,只要愿意借鉴,只管拿来就可以啦。 以下是本人在借鉴mobber和Jabber源代码的基础上开发的手机Jabber客户端部分界面: 1、登录界面

2、好友列表
3、设置好友界面
为了更好的了解XMPP协议,附上XMPP协议说明,可以在此基础上开发更多的客户端。 【附】XMPP协议说明
基本的jabber客户端必须实现以下标准协议(XEP-0211)
1、RFC3920 Core [url]http://tools.ietf.org/html/rfc3920 [/url]
2、RFC3921 Instant Messaging and Presence [url]http://tools.ietf.org/html/rfc3921 [/url]
3、XEP-030 Service Discovery [url]http://www.xmpp.org/extensions/xep-0030.html[/url]
4、XEP-0115 Entity Capabilities [url]http://www.xmpp.org/extensions/xep-0115.html[/url]
基本的jabber服务器必须实现以下标准协议(XEP-0212)
1、RFC3920 Core [url]http://tools.ietf.org/html/rfc3920 [/url]
2、RFC3921 Instant Messaging and Presence [url]http://tools.ietf.org/html/rfc3921 [/url]
3、XEP-030 Service Discovery [url]http://www.xmpp.org/extensions/xep-0030.html[/url]
一、注册
XEP-0077 In-Band Registration [url]http://www.xmpp.org/extensions/xep-0077.html[/url]
二、登录
XEP-0020 Software Version [url]http://www.xmpp.org/extensions/xep-0092.html [/url]
三、好友列表
XEP-0083 Nested Roster Groups [url]http://www.xmpp.org/extensions/xep-0083.html[/url]
1、获取好友列表
2、存储好友列表
XEP-0049 Private XML Storage [url]http://www.xmpp.org/extensions/xep-0049.html[/url]
3、备注好友信息
XEP-0145 Annotations [url]http://www.xmpp.org/extensions/xep-0145.html[/url]
4、存储书签
XEP-0048 Bookmark Storage [url]http://www.xmpp.org/extensions/xep-0048.html[/url]
5、好友头像
XEP-0008 IQ-Based Avatars [url]http://www.xmpp.org/extensions/xep-0008.html[/url]
XEP-0084 User Avatar [url]http://www.xmpp.org/extensions/xep-0084.html[/url]
XEP-0054 vcard-temp [url]http://www.xmpp.org/extensions/xep-0054.html[/url]
四、用户状态
RFC-3921 Subscription States [url]http://www.ietf.org/rfc/rfc3921.txt[/url]
五、文本消息
1、在线消息
2、离线消息
XEP-0013 Flexible Offline Message Retrieval [url]http://www.xmpp.org/extensions/xep-0013.html[/url]
XEP-0160 Best Practices for Handling Offline Messages [url]http://www.xmpp.org/extensions/xep-0160.html[/url]
XEP-0203 Delayed Delivery [url]http://www.xmpp.org/extensions/xep-0203.html[/url]
3、聊天状态通知
XEP-0085 Chat State Notifications [url]http://www.xmpp.org/extensions/xep-0085.html[/url]
六、群组聊天
1、XEP-0045 Multi-User Chat [url]http://www.xmpp.org/extensions/xep-0045.html[/url]
七、文件传输
1、XEP-0095 Stream Initiation [url]http://www.xmpp.org/extensions/xep-0095.html[/url]
2、XEP-0096 File Transfer [url]http://www.xmpp.org/extensions/xep-0096.html[/url]
3、XEP-0065 SOCKS5 Bytestreams [url]http://www.xmpp.org/extensions/xep-0065.html[/url]
4、XEP-0215 STUN Server Discovery for Jingle [url]http://www.xmpp.org/extensions/xep-0215.html[/url]
5、RFC-3489 STUN [url]http://tools.ietf.org/html/rfc3489[/url]
八、音视频会议
1、XEP-0166 Jingle [url]http://www.xmpp.org/extensions/xep-0166.html#negotiation[/url]
2、XEP-0167 Jingle Audio via RTP [url]http://www.xmpp.org/extensions/xep-0167.html[/url]
3、XEP-0176 Jingle ICE Transport [url]http://www.xmpp.org/extensions/xep-0176.html[/url]
4、XEP-0180 Jingle Video via RTP [url]http://www.xmpp.org/extensions/xep-0180.html#negotiation[/url]
5、XEP-0215 STUN Server Discovery for Jingle [url]http://www.xmpp.org/extensions/xep-0215.html[/url]
6、RFC-3489 STUN [url]http://tools.ietf.org/html/rfc3489[/url]
九、用户查询
XEP-0055 Jabber Search [url]http://www.xmpp.org/extensions/xep-0055.html[/url]
整体:
一、协议数据交互
XEP-0004 Data Forms [url]http://www.xmpp.org/extensions/xep-0004.html[/url]
二、jabber-RPC
XEP-0009 Jabber-RPC [url]http://www.xmpp.org/extensions/xep-0009.html[/url]
三、功能协商
XEP-0020 Feature Negotiation [url]http://www.xmpp.org/extensions/xep-0020.html[/url]
四、服务发现
XEP-0030 Service Discovery [url]http://www.xmpp.org/extensions/xep-0030.html[/url]
五、会话建立
XEP-0116 Encrypted Session Negotiation [url]http://www.xmpp.org/extensions/xep-0116.html[/url]
XEP-0155 Stanza Session Negotiation [url]http://www.xmpp.org/extensions/xep-0155.html[/url]
XEP-0201 Best Practices for Message Threads [url]http://www.xmpp.org/extensions/xep-0201.html[/url]