public Boolean checkIfUserExists(String user) throws XMPPException{ UserSearchManager search = new UserSearchManager(xmppConnection); Form searchForm = search.getSearchForm("search."+xmppConnection.getServiceName()); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", user); ReportedData data = search.getSearchResults(answerForm,"search."+xmppConnection.getServiceName()); if (data.getRows() != null) { Iterator<Row> it = data.getRows(); while (it.hasNext()) { Row row = it.next(); Iterator iterator = row.getValues("jid"); if (iterator.hasNext()) { String value = iterator.next().toString(); System.out.println("Iteartor values...... " + value); } } return true; } return false; }
UserSearchManager usm= new UserSearchManager(xmpp.getConnection()); Form searchForm = usm.getSearchForm("search." +xmpp.getConnection().getServiceName()); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", userName); ReportedData data = usm .getSearchResults(answerForm, "search." + xmpp.getConnection().getServiceName()); if (data.getRows() != null) { for (ReportedData.Row row: data.getRows()) { for (String jid:row.getValues("jid")) { System.out.println(jid); } } }
for (ReportedData.Row row : data.getRows() ) { if (!row.getValues(columnnames.get(0)).isEmpty()) { String s = row.getValues(columnnames.get(0))
for ( final Row row : data.getRows() ) { modelList = new ArrayList<>(); for (int i = 0; i < resultsTable.getColumnCount(); i++) {
List<ReportedData.Row> rows = results.getRows(); for (ReportedData.Row row : rows) { Log.d("***", "row: " + row.getValues("Username").toString());