How 2 implement Message reciever .......very confusing!

Hi ,

I gone thru the Smack docs and forums and still i dont get on how to actually code for smack message lisnet do I just need to implement ConnectionListener, PacketListener or I need to start a thread and implement this rrun meathod ?? Code snippet in smack documentation is really confusing …can some kind soul who has actually do this pl paste entire code of reciever class implementation …and help us all newb …or i do i walk alone in path to explore vit my seklf

You need to implement processPacket(Packet p) of PacketListener with some type of PacketFilter. There are three types of packets: iq, message, presence. Just filter your message packets and do appropriate things with them (get some info and start a chat or something else). Hope this helps

You just need to implement

processPacket(Packet packet) {

}

/code

And then add this to your connection, perform whatever logic you want in the process method