Can i get online users in my friend list via Smack API? Is it possible?
I am working on app which have chat between users. I had successfully created chat application example just entering name of friend and send chat, but now I want online friends list.
Roster roster = xmppConnection.getRoster();
Collection<RosterEntry> entries = roster.getEntries();
Presence presence;
for(RosterEntry entry : entries) {
presence = roster.getPresence(entry.getUser());
System.out.println(entry.getUser());
System.out.println(presence.getType().name());
System.out.println(presence.getStatus());
}