android - How can i search more than one Username by UserSearchManager in openfire using smack -
i creating chat app using smack library , openfire server xmpp protocol. first searched username usersearchmanager , got jid. working good.
but have lot of username , want search username usersearchmanager. can calling 1 one hit server again , again. please suggest me how can search username @ 1 time search hit.
this code using search single username.
usersearchmanager search = new usersearchmanager(connection); form searchform = search.getsearchform("search." + connection.getservicename()); form answerform = searchform.createanswerform(); answerform.setanswer("search", "rahul rawat"); answerform.setanswer("username", true); reporteddata data = search.getsearchresults(answerform, "search." + connection.getservicename()); system.out.println("\nthe jids our each of our hits:"); iterator<row> rows = data.getrows(); while (rows.hasnext()) { row row = rows.next(); iterator<string> jids = row.getvalues("jid"); while (jids.hasnext()) { system.out.println(jids.next()); } }
Comments
Post a Comment