我有eclipse的问题,它说没有实例化类型xmppconnection,请告诉我我的代码有什么问题
这是我的代码
}
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;
}
}
答案 0 :(得分:1)
试试这个:
new smack version using `XMPPTCPConnection connection = new XMPPTCPConnection(config)`
instead of `XMPPConnection connection = new XMPPConnection(config);`