0
votes

I am fiddling with Smack on Android and utterly confused as to how to integrate my own database users with this XMPP client. From what I understood, XMPP has its own notion of users and groups with their login credentials. Also, they have helper objects for Chat and ChatManager.

I have my own database of users, and chat messages which I want to store at my server and device. Let us say the user has id - id1. Now:

  • how do i authenticate the user, i mean what would be the credentials.
  • how to listen to the incoming messages for the current user.
  • can i use REST interface to send chat messages to my server and not through XMPP client - in that case would the above listener would still work ?
  • Using smack - do i still get the control to manage what object i use for Chat message for communication between my server and client.

Basically, I think I am not able to visualize the stuff happening behind the scenes at server (or how to implement it ). Can some one please explain the very basics or point to me in the right direction.

1

1 Answers

0
votes
  1. You need to have XMPP server application (ejabberd, prosody, openfire, tigase, etc.) to authenticate users. Most of XMPP servers are able to authenticate users against your own user database/REST API, or you can write simple plugin/script. You can write your own XMPP server too, but it may be too complex task.
  2. Smack documentation provide useful messaging examples
  3. Your REST interface may send XMPP messages too, or you may need to write additional XMPP server plugins to monitor new messages in your database, depends on your service architecture
  4. Your can extend XMPP message as you like, just keep your extended message fields in your own XML namespace. Of course, you may need to extend XMPP library both on client and server to support these new message elements.