未能实例化th类型xmppconnection
我对eclipse有一个问题,它说未能实例化xmppconnection类型,请告诉我我的代码有什么问题 这是我的密码未能实例化th类型xmppconnection,xmpp,Xmpp,我对eclipse有一个问题,它说未能实例化xmppconnection类型,请告诉我我的代码有什么问题 这是我的密码 } public boolean login(String a,String p){ ConnectionConfiguration config = new ConnectionConfiguration("gcm.googleapis.com", PORT); /** */ config.setSASLAuthentication
}
public boolean login(String a,String p){
ConnectionConfiguration config = new ConnectionConfiguration("gcm.googleapis.com", PORT);
/** */
config.setSASLAuthenticationEnabled(false);
/** */
config.setDebuggerEnabled(true);
/** connection */
XMPPConnection connection = new XMPPConnection(config);
try {
/** */
connection.connect();
/** */
connection.login(a, p);
/** ?*/
//ClientSendThread cst=new ClientSendThread(connection);
//cst.start();
//ManageClientThread.addClientSendThread(a, cst);
return true;
} catch (XMPPException e) {
e.printStackTrace();
}
return false;
}
}试试这个:
new smack version using `XMPPTCPConnection connection = new XMPPTCPConnection(config)`
instead of `XMPPConnection connection = new XMPPConnection(config);`