0 0

xmpp android demo不能连接服务器10

我在做一个im聊天工具基于xmpp,在网上找了些例子,建了个java工程能跑起来,但是我将它移植到android工程中就不能连接服务器,不知道为什么,求大神解答
ps:已经逃入了asmack的包了,java工程能连接,android的ip写的是10.0.0.2,用户名密码都对


XMPPConnection.DEBUG_ENABLED = true;

final ConnectionConfiguration connectionConfig = new ConnectionConfiguration("10.0.0.2", 5222, "");
connectionConfig.setSASLAuthenticationEnabled(false);
try {

XMPPConnection connection = new XMPPConnection(connectionConfig);
connection.connect();//连接
connection.login("cc959798", "cc887652");//登陆
System.out.println(connection.getUser());
ChatManager chatmanager = connection.getChatManager();
2014年2月26日 22:22
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics