how to create username , address and details with firebase authentication

Viewed 467

I know how to create email and password authentication with firebase but that will create only email and id but how do i add name and more detail to that id for instance how I call user.getdisplayname?

Here is my code for creating authentication email and password

bv.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
                final ProgressDialog pros=ProgressDialog.show(Register.this,"please wait..","registerring..",true);
        mAuth.createUserWithEmailAndPassword(email.getText().toString(),password.getText().toString()).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {
                pros.dismiss();
                if(task.isSuccessful()){
                    Toast.makeText(Register.this,"sucsseful",Toast.LENGTH_LONG).show();
                    Intent i=new Intent(Register.this,login.class);
                }else {
                    Log.e("ERROr",task.getException().toString());
                    Toast.makeText(Register.this,task.getException().getMessage(),Toast.LENGTH_LONG).show();
                }
            }
        });

If you say to create database as well, then how I link it to the user authentication?

private FirebaseUser UserDetaill = FirebaseAuth.getInstance().getCurrentUser() ;
1 Answers
Related