title: How I get the all user state infromation(offline/online/away/etc.) by XMPP aSmack
body: <p>I am trying to implement android chat application by using XMPP(aSmack).I check my code are correct are okay for login ,registration.Now i am trying to get all user information (offline/online/away/etc.) I try to used by Presence.But i can't success.When the xmpp connection are okay and user login success then i call the  Presence by</p>
  
  <pre><code>if (connection != null &amp;&amp; connection.isConnected()) {
          Presence presence = new Presence(Presence.Type.available);
          presence.setStatus("I’m available");
          connection.sendPacket(presence);
          Log.w("type", "I’m available");
      }
  </code></pre>
  
  <p>After calling this function then i try to get  all user information .My Roster code are:</p>
  
  <pre><code>    Roster roster = connection.getRoster();
      // Get all rosters
      Collection&lt;RosterEntry&gt; entries = roster.getEntries();
      Log.w("Size ", "are"+entries.size());
      // loop through
      for (RosterEntry entry : entries) {
          // example: get presence, type, mode, status
          Presence entryPresence = roster.getPresence(entry.getUser());
          Presence.Type userType = entryPresence.getType();
          Presence.Mode mode = entryPresence.getMode();
          String status = entryPresence.getStatus();
  
          Log.w("mode ", "are"+mode);
          Log.w("status ", "are"+status);
          Log.w("mode ", "are"+entryPresence.isAvailable());
      }
  </code></pre>
  
  <p>But my problem,All the time i get  one entries size,who i am.without my mode show all the time false(That means i am unavailable).I don't understand what it the problem.I need work on server config. again.or My code are wrong.Please help to me how i can solve those two issues.Thanks all.</p>