AnsweredAssumed Answered

Smack roster listeners..under the hood

Question asked by Aparna on Aug 6, 2015
Latest reply on Aug 6, 2015 by Flow

I am developing an android client for an XMPP server.

The app is expected to have extended periods of user inactivity, where updated roster is not required.

However, the user should still be able to receive notifications of chat invites.

My question is:

1. Is it possible to register and de-register a listener exclusively for roster updates?

    The idea here is to avoid the overhead of maintaining the roster when its not required.

    I know Smack API provides a 'Roster Listener' for this purpose.

    But how is this actually implemented? Does the client create and maintain one TCP connection with the server over which it sends and receives all XML stanzas?

    If so, does deregistering the roster listener stop roster update messages from coming in though this channel?

   

2. Now, assuming we deregistered the roster listener when the app paused.

    We will register again when the app resumes.

    How will we get the latest presence information of all contacts in the roster?

    Is there any API that returns the  presence information of all contacts in roster?

 

I am quite new to the XMPP domain. I am going through RFCs 6121 and 6120.

Some inputs from experts will help to make sense of it all!

 

Thanks,

Aparna

Outcomes