XMPP客户端库Smack 4.0.6版开发
作者:chszs,转载需注明。博客主页:http://blog.csdn.net/chszs
三、Smack库的特征
1、极度简单易用,API功能强大
发送一条文本消息给某个用户只需几行代码:
AbstractXMPPConnection connection = new XMPPTCPConnection("mtucker", "password", "jabber.org"); connection.connect(); connection.login(); Chat chat = ChatManager.getInstanceFor(connection) .createChat("jsmith@jivesoftware.com", new MessageListener(){ public void processMessage(Chat chat, Message message){ System.out.println("Received message: " + message); } }); chat.sendMessage("Howdy!");
原文地址:http://blog.csdn.net/chszs/article/details/41576877