androidclient-serverejabberdsmackasmack

How to get contact list from ejabbered server


Hi i am able to connect and chat using ejabbered server. I followed this tutorial for smack api and i am using

compile 'org.igniterealtime.smack:smack-android-extensions:4.1.0-alpha6'

i searched on internet for this but so far not able to get the list of online users from own server. Any help will be highly appreciated. Thanks


Solution

  • Finally i am able to get rid of this problem

    in ContactModel.java class i added

    Roster roster = RoosterConnection.mConnection.getRoster();
    Collection<RosterEntry> entries = roster.getEntries();
    

    here RoosterConnection.mConnection is XMPPTCPConnection In the version 4.1.0 method of getting Roster is bit changed. Hope it will be helpful for others. Here is the official documentation/ update-guide link