powered by Jive Software

How to send, receive, and Accept friend request using asmack?

I’m creating chat application for android, I’m using openfire server, I’m less familier with asmack and XMPP. I have some basic question as listed bellow.

  1. How to start chat?

  2. Is it necessary to sending, receiving, and accepting friend request before starting chat?

  3. If it is, how to do it.

  4. Is it required any Service, or Broadcast Receiver to receive the request or chat messages?

Thank You


I am not familiar with aSmack but with Smack, but in regards to your questions, this should not make a difference.

  1. See http://www.igniterealtime.org/builds/smack/docs/latest/documentation/messaging.h tml

  2. No. Messages are delivered, even if both sender and receiver don’t know each other.

  3. See http://www.igniterealtime.org/builds/smack/docs/latest/documentation/roster.html

and http://xmpp.org/rfcs/rfc6121.html#sub

User A needs to send a subscription request to User B. User B then either accepts or declines it by sending a presence of type “subscribed” or “unsubscribed” back to User A.

  1. I don’t quite understand the question, but probably the answer is no.