3

I wrote an XMPP chat client (Google Talk) for android using asmack, an android port of smack.

I am using it to chat with users on chat in gmail. Messages sent from my client get delivered perfectly. But only some chat messages sent from gmail are received. While text is being entered into the chat box in gmail (before the enter key is pressed), I receive messages. These messages always have a NULL body. I assumed these null packets correspond to the "Typing.." message. However even when the actual text messge is sent (the enter key is pressed), the message doesn't always get delivered.I still get a NULL body. I am implementing my MessageListener like this

public void processMessage(Chat arg0, final Message message) {
    System.out.println(message.getType());
    if(message.getBody()!=null) {
        //do stuff
    }
    System.out.println("message body: "+ message.getBody());

}

I also happened to notice that if multiple messages are sent in a short span of time, the likelihood of them getting delivered (non-null message bodies) is higher.

Has anyone experienced similar problems? Any help would be much appreciated.

sej101
  • 225
  • 2
  • 11

0 Answers0