0
我想使用Smack從我的Android客戶端向GAE服務器發送XMPP消息。 我讀了this post與gmail設置,並得到它應該如何完成的想法。但我不知道如何爲我的Google應用引擎帳戶設置host
和serviceName
。如何使用Smack從Android發送XMPP消息到GAE
String host = "talk.google.com";
int port = 5222;
String serviceName gmail.com;
ConnectionConfiguration connConfig = new ConnectionConfiguration(host ,port , serviceName);
XMPPConnection connection = new XMPPConnection(connConfig);
connection.connect();
Message msg = new Message(to, Message.Type.chat);
msg.setBody(text);
connection.sendPacket(msg);
謝謝,現在我更清楚一點了。我沒有看到鏈接中的任何Java代碼。也許你知道在java中的教程? – Rami
也許你可以使用谷歌搜索'xmpp bosh java客戶端'。 – dragonx
謝謝,我想我明白了。 – Rami