當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseUser.setPassword方法代碼示例

本文整理匯總了Java中com.parse.ParseUser.setPassword方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseUser.setPassword方法的具體用法?Java ParseUser.setPassword怎麽用?Java ParseUser.setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.parse.ParseUser的用法示例。


在下文中一共展示了ParseUser.setPassword方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: cadastrarUsuario

import com.parse.ParseUser; //導入方法依賴的package包/類
private void cadastrarUsuario() {

        //Cria objeto usuario
        ParseUser usuario = new ParseUser();
        usuario.setUsername(textoUsuario.getText().toString());
        usuario.setEmail(textoEmail.getText().toString());
        usuario.setPassword(textoSenha.getText().toString());

        //salva dados do usuario
        usuario.signUpInBackground(new SignUpCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {//sucesso ao salvar
                    Toast.makeText(CadastroActivity.this, "Cadastro feito com sucesso!",
                            Toast.LENGTH_LONG).show();
                    abrirLoginUsuario();
                } else {//erro ao salvar
                    ParseErros parseErros = new ParseErros();
                    String erro = parseErros.getErro(e.getCode());
                    Toast.makeText(CadastroActivity.this, erro, Toast.LENGTH_LONG).show();
                }
            }
        });

    }
 
開發者ID:FilipeAlbuquerque,項目名稱:EletroFisio,代碼行數:26,代碼來源:CadastroActivity.java

示例2: signUp

import com.parse.ParseUser; //導入方法依賴的package包/類
private void signUp(){
    ParseUser user = new ParseUser();
    user.setUsername(USER_NAME);
    user.setPassword(PASSWORD);
    user.setEmail(EMAIL);
    user.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                login();
                Toast.makeText(getApplicationContext(), "Login cadastrado com sucesso", Toast.LENGTH_SHORT).show();
            }else{
                Toast.makeText(getApplicationContext(), "Erro ao cadastrar login", Toast.LENGTH_SHORT).show();
            }
        }
    });
}
 
開發者ID:rudsonlive,項目名稱:ParseLiveo,代碼行數:17,代碼來源:MainActivity.java

示例3: doInBackground

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
protected Bundle doInBackground(Bundle... bundles) {
    Bundle bundle = bundles[0];
    ParseUser currentUser = ParseUser.getCurrentUser();
    if (bundle.getString(ParseTables.Users.NAME) != null) {
        currentUser.put(ParseTables.Users.NAME, bundle.getString(ParseTables.Users.NAME));
    }
    if (bundle.getString(ParseTables.Users.EMAIL) != null) {
        currentUser.put(ParseTables.Users.EMAIL, bundle.getString(ParseTables.Users.EMAIL));
        currentUser.setUsername(bundle.getString(ParseTables.Users.EMAIL));
    }
    if (bundle.getString(ParseTables.Users.DOB) != null) {
        currentUser.put(ParseTables.Users.DOB, bundle.getString(ParseTables.Users.DOB));
    }
    try {
        if (currentUser.getSessionToken() != null) {
            currentUser.save();
        } else {
            currentUser.setPassword("todoGenerateARandomString");
            currentUser.signUp();
        }
    } catch (ParseException e) {
        e.printStackTrace();
    }
    return bundle;
}
 
開發者ID:teamOSC,項目名稱:Studddinv2_android,代碼行數:27,代碼來源:SignOnFragment.java

示例4: initChangePass

import com.parse.ParseUser; //導入方法依賴的package包/類
public void initChangePass(final View v) {

        if (mPasswordField.getText().length() == 0) {
            mPasswordField.setText("Password can't be empty!");
            return;
        }
        v.setEnabled(false);
        spinner.setVisibility(View.VISIBLE);
        mErrorField.setText("");
        InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        mgr.hideSoftInputFromWindow(mPasswordField.getWindowToken(), 0);
        ParseUser curUser = ParseUser.getCurrentUser();
        curUser.setPassword(mPasswordField.getText().toString());
        curUser.saveInBackground();
        spinner.setVisibility(View.GONE);
    }
 
開發者ID:bhavyanshu,項目名稱:TemplateAppParse-dot-com,代碼行數:17,代碼來源:ChangePassActivity.java

示例5: registerOnClick

import com.parse.ParseUser; //導入方法依賴的package包/類
public void registerOnClick(View v) {
    name = userName.getText().toString();
    pass = password.getText().toString();
    mail = Mail.getText().toString();
    if(name.length() < 4 || pass.length() < 6 || mail.length() == 0)
        System.out.println("Something has fucked up");
    final ParseUser user = new ParseUser();
    user.setUsername(name);
    user.setEmail(mail);
    user.setPassword(pass);
    System.out.println("Request sent");
    user.signUpInBackground(new SignUpCallback() {
        @Override
        public void done(ParseException e) {
            System.out.println("Got Response");
            if(e == null) {
                startActivity(new Intent(Register.this, UserList.class));
            }
            else e.printStackTrace();
        }
    });
}
 
開發者ID:getsadzeg,項目名稱:mtredi,代碼行數:23,代碼來源:Register.java

示例6: connectToParse

import com.parse.ParseUser; //導入方法依賴的package包/類
public void connectToParse(){
    Profiles profiles = Profiles.getInstance();
    String loginUser = profiles.loginEmail.replace("@ualberta.ca", "");
    //create new user
    ParseUser userParse = new ParseUser();
    userParse.setUsername(loginUser);
    userParse.setPassword(loginUser);
    userParse.setEmail(profiles.loginEmail);

    userParse.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                // Hooray! Let them use the app now.
                initiateParse();
                startApp();
            } else {
                // Sign up didn't succeed. Look at the ParseException
                // to figure out what went wrong
                login();
            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:24,代碼來源:MainActivity.java

示例7: signup

import com.parse.ParseUser; //導入方法依賴的package包/類
private void signup(String usernametxt, String passwordtxt) {
    if (!isEmpty()){

        int numberParse = 0;
        ParseQuery<ParseUser> numberofUsers = ParseUser.getQuery();  // Note to myself : count users in parse class
        try {
            numberParse=numberofUsers.count();
        } catch (ParseException e1) {
            e1.printStackTrace();
        }
        user = new ParseUser();
        user.setUsername(usernametxt);
        user.setPassword(passwordtxt);
        user.put("userID",numberParse+1);
        user.signUpInBackground(new SignUpCallback() {
            public void done(ParseException e) {
                checkSignup(e);
            }
        });
    }
}
 
開發者ID:safakesberk,項目名稱:Cloud_Base-To-Do-App,代碼行數:22,代碼來源:LoginSignupActivity.java

示例8: createAccount

import com.parse.ParseUser; //導入方法依賴的package包/類
@OnClick(R.id.saveNewAccount) void createAccount(View view) {
    ParseUser parseUser = new ParseUser();
    parseUser.setUsername(newUser.getText().toString());
    parseUser.setEmail(newUser.getText().toString());
    parseUser.setPassword(newPassword.getText().toString());
    parseUser.put(Constants.PARSE_USER_ATTR_NAME, newName.getText().toString().trim());

    parseUser.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                // Hooray! Let them use the app now.
                Log.e(LOG_TAG, "Hooray! Let them use the app now");
                Toast.makeText(getApplicationContext(), "Hooray! Let them use the app now", Toast.LENGTH_SHORT).show();
                handleAccountCreated();

            } else {
                // Sign up didn't succeed. Look at the ParseException
                // to figure out what went wrong
                Log.e(LOG_TAG, "Sign up didn't succeed. Look at the ParseException");
                Toast.makeText(getApplicationContext(), "Sign up didn't succeed. Look at the ParseException", Toast.LENGTH_SHORT).show();
            }
        }
    });
}
 
開發者ID:dougritter,項目名稱:mirante,代碼行數:25,代碼來源:NewAccountActivity.java

示例9: createUser

import com.parse.ParseUser; //導入方法依賴的package包/類
@OnClick(R.id.createAccountButton) void createUser(View view){
    ParseUser parseUser = new ParseUser();
    parseUser.setUsername(personName.getText().toString());
    parseUser.setEmail(email.getText().toString());
    parseUser.setPassword(password.getText().toString());

    parseUser.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                // Hooray! Let them use the app now.
                Log.e(LOG_TAG, "Hooray! Let them use the app now");
                Toast.makeText(getApplicationContext(), "Hooray! Let them use the app now", Toast.LENGTH_SHORT).show();

            } else {
                // Sign up didn't succeed. Look at the ParseException
                // to figure out what went wrong
                Log.e(LOG_TAG, "Sign up didn't succeed. Look at the ParseException");
                Toast.makeText(getApplicationContext(), "Sign up didn't succeed. Look at the ParseException", Toast.LENGTH_SHORT).show();
            }
        }
    });

}
 
開發者ID:dougritter,項目名稱:mirante,代碼行數:24,代碼來源:MainActivity.java

示例10: register

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void register(String email, String username, String password, Bitmap profilePicture) {

    final ParseUser user = new ParseUser();
    user.setEmail(email);
    user.setUsername(username);
    user.setPassword(password);

    if (profilePicture != null){
        byte[] pfArray = getBytesFromBitmap(profilePicture);
        final ParseFile file = new ParseFile("abc.png", pfArray);
        file.saveInBackground();

        file.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null){
                    user.put("photo", file);
                    signUpInBackground(user);
                } else {
                    EventBus.getDefault().post(new RegisterCallbackEvent(false,e.getMessage()));
                }
            }
        });
    } else {
        signUpInBackground(user);
    }
}
 
開發者ID:Antpachon,項目名稱:RegLog,代碼行數:29,代碼來源:RegisterServiceParseImpl.java

示例11: signup

import com.parse.ParseUser; //導入方法依賴的package包/類
/**
 * Creates a new user in the Parse backend using the provided credentials
 *
 * @param teamNumber the team number to signup to
 * @param email      the email of the user
 * @param pass       the password of the user account
 */
public void signup(final String teamNumber, final String email, String pass, final View view) {
    if (!isNetworkAvailable()) {
        Snackbar.make(view, "Unable to connect to the Internet. Try again.", Snackbar.LENGTH_SHORT).show();
        return;
    }

    // Make sure all fields are filled in
    if (teamNumber.equals("") || email.equals("") || pass.equals("")) {
        Snackbar.make(view, "Please fill in all fields.", Snackbar.LENGTH_SHORT).show();
        return;
    }

    // Create new ParseUser object to signup with field credentials
    ParseUser user = new ParseUser();
    user.setEmail(email);
    user.setUsername(email);
    user.setPassword(pass);
    user.put("Team", teamNumber);

    user.signUpInBackground(new SignUpCallback() {
        @Override
        public void done(ParseException e) {
            // Signup was successful, no exception
            if (e == null) {
                Snackbar.make(view, "Successfully signed up.", Snackbar.LENGTH_SHORT).show();
                sessionManager.createLoginSession(teamNumber, email);
                startActivity(new Intent(getApplicationContext(), TeamListActivity.class));
                finish();
            } else {
                Snackbar.make(view, "Unable signed up. Please try again.", Snackbar.LENGTH_SHORT).show();
                password.setText("");
                passwordAgain.setText("");
            }
        }
    });

}
 
開發者ID:sirvar,項目名稱:roboscout,代碼行數:45,代碼來源:SignupActivity.java

示例12: handleSignup

import com.parse.ParseUser; //導入方法依賴的package包/類
public void handleSignup(final View view)
{
	showProgress();
	ParseUser user = ParseUser.getCurrentUser();
	user.setUsername(usernameText.getText().toString());
	user.setPassword(passwordText.getText().toString());
	user.setEmail(emailText.getText().toString());

       user.saveInBackground(new SaveCallback()
	{
		public void done(ParseException e)
		{
			if (e == null)
			{
				// Hooray! Let them use the app now.
				Ln.d("Hooray!");
				handleLogin(view);
			}
			else
			{
				// Sign up didn't succeed. Look at the ParseException
				// to figure out what went wrong
				e.printStackTrace();
			}
		}
	});
}
 
開發者ID:pagesjaunes,項目名稱:androidMobileDeviceManager,代碼行數:28,代碼來源:BootstrapAuthenticatorActivity.java

示例13: signup

import com.parse.ParseUser; //導入方法依賴的package包/類
public void signup() {
    final Intent myintent = new Intent(getActivity(),HomePage.class);
    if (!name.getText().toString().isEmpty() && !email.getText().toString().isEmpty() && !pass.getText().toString().isEmpty()  && !repass.getText().toString().isEmpty() && pass.getText().toString().equals(repass.getText().toString()) && pass.getText().toString().length() >= 6)
    {
        ParseUser user = new ParseUser();
        user.setUsername(email.getText().toString());
        user.setPassword(pass.getText().toString());
        user.setEmail(email.getText().toString());
        user.put("Name",name.getText().toString());

        user.signUpInBackground(new SignUpCallback() {
            public void done(ParseException e) {
                if (e == null) {
                    showSuccess("Please verify your email, then click the login button");
                    firebaseSignUp(email.getText().toString());
                } else {
                    showIssue(e.toString());
                }
            }
        });
    }else if (name.getText().toString().isEmpty() || email.getText().toString().isEmpty() || pass.getText().toString().isEmpty()  || repass.getText().toString().isEmpty()){
        showIssue("Please makes sure you fill out all the fields properly!");
    }else if(!pass.getText().toString().equals(repass.getText().toString())){
        showIssue("Oops your passwords do not match, please try again");
    }else if(pass.getText().toString().length()<6){
        showIssue("Please make sure your password is at least six characters long");
    }
}
 
開發者ID:hackathoner,項目名稱:Barter,代碼行數:29,代碼來源:SignIn.java

示例14: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public void onCreate() {
	  Parse.initialize(this, "8FttRlqaAUPabxXzuLeTMbmgAA389L7oVbFaSqjj", "6sFwktakiPYSDg1NKzgP18yanSjlB9CQKFGUOShs");
	  // Also in this method, specify a default Activity to handle push notifications
	  PushService.setDefaultPushCallback(this, Notification.class);
	// PushService.subscribe(this, "Everyone", Notification.class);
	
	  ParseInstallation.getCurrentInstallation().saveInBackground();
	  ParseObject.registerSubclass(Message.class);
			  
    // ParsePush.subscribeInBackground("Giants");

	  ParseUser user = new ParseUser();			 
	  user.setUsername("caip");
	  user.setPassword("piacpiac");
	  user.setEmail("[email protected]");
	  
	  ParseUser user_2 = new ParseUser();		  
	  user_2.setUsername("professor");
	  user_2.setPassword("prof_iprj");
	  user_2.setEmail("[email protected]");
	  
		 		    
	 user.signUpInBackground(new SignUpCallback() {
	    @Override
		public void done(ParseException e) {
	      if (e == null) {
	        // Hooray! Let them use the app now.
	      } else {
	        // Sign up didn't succeed. Look at the ParseException
	        // to figure out what went wrong
	      }
	    }
	  });
	  
	}
 
開發者ID:Paulocajr,項目名稱:IPRJapp,代碼行數:38,代碼來源:My_Application.java

示例15: onClick

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if(!validate()){
        return;
    }

    // Check if password match
    final String password = passwordField.getText().toString();
    if(!password.equals(confirmPasswordField.getText().toString())){
        confirmPasswordField.setError(MyApp.getAppContext().getString(R.string.passwordNotMatch));
        confirmPasswordField.setText("");
        confirmPasswordField.requestFocus();
        return;
    }

    String username = usernameField.getText().toString();
    String email = emailField.getText().toString();
    ParseUser user = new ParseUser();
    // Set standard fields
    user.setUsername(username);
    user.setPassword(password);
    user.setEmail(email);

    loadingStart();
    user.signUpInBackground(new SignUpCallback() {

        @Override
        public void done(ParseException e) {
            if (isActivityDestroyed()) {
                return;
            }

            if (e == null) {
                loadingFinish();
                signupSuccess();
            } else {
                loadingFinish();

                switch (e.getCode()) {
                    case ParseException.INVALID_EMAIL_ADDRESS:
                        showToast(R.string.invalidEmail);
                        break;
                    case ParseException.USERNAME_TAKEN:
                        showToast(R.string.usernameTaken);
                        break;
                    case ParseException.EMAIL_TAKEN:
                        showToast(R.string.emailTaken);
                        break;
                    default:
                        showToast(R.string.unknownSignupError);
                }
            }
        }
    });
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:56,代碼來源:ParseSignupFragment.java


注:本文中的com.parse.ParseUser.setPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。