问问题
1936 次
1 回答
4
- First of all, I don't think your code can run, because after you check connection == null, you do not init connection, just use: connection = new XMPPConnection(config);
- I have met the situation of un-known host, the problem is that we do not specify the service name in the constructor of the ConnectionConfiguration (you specified it as an empty string). Normally, if user's email is of the form : user@something.com, the service name will be "something.com". Anyway, you can get the exact service name after you are connected to the server (after connection.connect() succeeds) by using xmpp.getServiceName() (You can log to see the result, for example: Log.e("Service Name", xmpp.getServiceName()), then see the Logcat and copy the service name into the constructor).
- Enjoyed. :)
于 2012-09-05T04:17:15.457 回答