@Background void createAccount( String emailAddress, String name, String surname, String userName, String pass) { userRESTClient = new UserRESTClient(new BarazkideConnectionData(prefs)); User user = userRESTClient.getUserByEmailAddress(emailAddress); if (!UserUtils.isEmptyUser(user)) { // Retrieve user createAccountResult(USER_EXISTS); return; } user = userRESTClient.getUserByScreenName(userName); if (!UserUtils.isEmptyUser(user)) { // Retrieve user createAccountResult(USER_EXISTS); return; } user = userRESTClient.addUser( false, pass, pass, false, userName, emailAddress, 0, "openId", "es_ES", name, null, surname, 1, 1, true, 1, 1, 2000, null, null, null, null, null, true); if (!UserUtils.isEmptyUser(user)) { // Check user has been created loginUser(user); createAccountResult(REGISTER_OK); } else { createAccountResult(REGISTER_ERROR); } }
@Background void validateUser() { if (txPass.getText().toString().equals("")) { validateUserResult(null); } else { userRESTClient = new UserRESTClient(new BarazkideConnectionData(prefs)); User user = userRESTClient.getUserByEmailAddress(txEmailAddress.getText().toString()); validateUserResult(user); } }