How to send a XMPP message from Android to GAE using Smack

admin

Administrator
Staff member
I want to send XMPP message from my android client to GAE Server using Smack.
I read <a href="http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/" rel="nofollow">this post</a> with gmail settings and got the idea of how it should be done. But I don't how to setup the
Code:
host
and
Code:
serviceName
for my google app engine account.

Code:
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);