This discussion is archived
0 Replies Latest reply: Jul 9, 2011 1:57 AM by 874394 RSS

presence notification in SMACK API

874394 Newbie
Currently Being Moderated
hello
i'm trying to implement a chat using SMACK API library ( http://www.igniterealtime.org/projects/smack/ ). now I have a problem to presence notification. this is my code:

public void displayBuddyList()
{
Roster roster = connection.getRoster();
Collection<RosterEntry> entries = roster.getEntries();
System.out.println("\n\n" + entries.size() + " buddy(ies):");
Presence presence;
for(RosterEntry r:entries)
{
System.out.println(r.getUser());
presence = roster.getPresence(r.getUser());
System.out.println(presence);
}
}

but my contacts are always unavailable Could you help me? pleaseeeeeeeeeee

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points