Xmpp Send And Receive Message In Android Application
I am working on a sms application. I am able to send a message from my application using the function sendMessage('subject' , 'to');. I need to know how to receive the message sen
Solution 1:
this will help you:
PacketFilter filter = new MessageTypeFilter(Message.Type.chat);
// Listener for incoming message from any user
connection.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
final Message message = (Message) packet;
if (message.getBody() != null) {
fromName = StringUtils.parseBareAddress(message
.getFrom());
Log.i("XMPPClient", "Got text [" + message.getBody()
+ "] from [" + fromName + "]");
}
}
});
}
}
}, filter);
Post a Comment for "Xmpp Send And Receive Message In Android Application"