The last period did not put the results chart it! Forget =-=, this is the last result map, TextView inside will display the name of the login (this is the default Administrator account =-=) Well, landed on the server we have the function of interaction can be said to be a big step forward! We're going to try to print out some data from the server (server-defined groups) let's get started. First I signed up for another three users to test also created a group (forgive my name of the boring), but also to specify the share names, and the user into the group members! Then write a Findman () function in the tool class to find the group and print Group:
1 Public Static voidFindman () {2System.out.println ("--------Find start----------");3ROSTER roster = Connect.con.getRoster ();//roster represents the list of all friends of a user and the list of users who are applying for a friend4collection<rostergroup> Entriesgroup = roster.getgroups ();//Get group Information5System.out.println ("Team:" +entriesgroup.size ()); 6 for(Rostergroup group:entriesgroup) {7collection<rosterentry> entries =group.getentries ();8System.out.println ("--------groupName--------" + "\ n" +group.getname ());//Cycle Print group names and names9 for(Rosterentry entry:entries) {TenSystem.out.println ("Name:" +entry.getname ()); One } A } -System.out.println ("--------Find End--------"); - the - } - -Complete these we call this function in the child activity to print what we want!
That's what we want!
This completes the second step of our interaction with the server! , we got the server's group data!
Operfire+asmack-built Android Instant Messenger (ii) 15.4.9