· 7 years ago · Jan 12, 2019, 03:36 PM
1Build simple chat in android app using XMPP and GAE
2public class XMPPAgentServlet extends HttpServlet
3{
4 public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException
5 {
6 try
7 {
8 String strStatus = "";
9 XMPPService xmpp = XMPPServiceFactory.getXMPPService();
10
11 Message msg = xmpp.parseMessage(req);
12 JID fromJid = msg.getFromJid();
13 String body = msg.getBody();
14
15 }
16 catch (Exception e)
17 {
18 ///
19 }
20 }
21
22ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com",5222, "gmail.com");
23
24XMPPConnection connection = new XMPPConnection(connConfig);
25connection.connect();