Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get mobile online status of the facebook user using smack?

Tags:

java

smack

I am developing Facebook chat application using smack.

  1. Here I want to get online user status of both mobile user's & website user's, and how can I differentiate both of them.
  2. If a user send message ,how can I differentiate he is mobile user (or) website user?
like image 470
user2709752 Avatar asked May 23 '14 06:05

user2709752


1 Answers

Why dont you get it from RosterEntry class

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());//This is what you wanted 
}
like image 179
dharam Avatar answered Nov 15 '22 17:11

dharam