谁能建议为什么 gethost() 返回null。如何连接我当前在本地配置的 openfire 服务器。
XMPPConnection connection;
ConnectionConfiguration config;
config = new ConnectionConfiguration("FR4YW1S", 5222);
connection = new XMPPConnection(config);
try {
connection.connect();
Log.i(LOG_TAG, "Successfully Connected");
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.e("LOG_TAG", "Failed to connect to " + connection.getHost());
Log.e(LOG_TAG, "Not Connected");
}