I have this code, almost unmodified from examples:
UserSearchManager usm = new UserSearchManager(conn);
Form searchForm = usm.getSearchForm("search.myserver.com");
Form answerForm = searchForm.createAnswerForm();
answerForm.setAnswer("Username", true);
answerForm.setAnswer("search", contact.getJid());
ReportedData data = usm.getSearchResults(answerForm, "search.myserver.com");
This works perfectly in a Desktop environment, using Smack library, but I can't get it to work in Android (where I have to use asmack).
The problem is searchForm is null because getSearchForm returns null. This seems to be pretty odd as I can't seem to find any documentation on which cases that method should return null.
The server is Openfire, if it helps.