我正在使用 Firebase 在 Android Studio 中使用电子邮件和密码创建注册,但使用全名

Im Creating Registration with email and Password but with Fullname in Android Studio with Firebase

我使用电子邮件和密码创建注册,但使用用户的全名并在用户登录时显示它我试图在 youtube 中找到教程,但没有人提供或者我只是找不到它,只有电子邮件和密码教程,

这里有人可以帮助我吗?

这是给 Android 我正在使用 Android Studio 我的后端是 Firebase

我要用户在注册 单击确认按钮时,全名将注册到 firebase 并显示在用户配置文件中。

非常感谢。

顺便说一句 我现在使用的代码是

progressBar.setVisibility(View.VISIBLE);
            //create user
            auth.createUserWithEmailAndPassword(email, password)
                    .addOnCompleteListener(SignupActivity.this, new OnCompleteListener<AuthResult>() {
                        @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {
                            Toast.makeText(SignupActivity.this, "createUserWithEmail:onComplete:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
                            progressBar.setVisibility(View.GONE);
                            // If sign in fails, display a message to the user. If sign in succeeds
                            // the auth state listener will be notified and logic to handle the
                            // signed in user can be handled in the listener.
                            if (!task.isSuccessful()) {
                                Toast.makeText(SignupActivity.this, "Authentication failed." + task.getException(),
                                        Toast.LENGTH_SHORT).show();
                            } else {
                                startActivity(new Intent(SignupActivity.this, MainActivity.class));
                                finish();
                            }
                        }
                    });

正如您所说,您找到了包含电子邮件和密码的教程。 按照这些教程,您唯一需要做的就是,在 XML 中编辑全名文本,并在注册期间检查它是否不为空,并使用 UID 在实时数据库中创建用户数据库。

 if (!emailAdd.equals("") || !pass.equals("") || (!name.eqauls(""){

                    mAuth.createUserWithEmailAndPassword(emailAdd, pass)
                            .addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                                @Override
                                public void onComplete(@NonNull Task<AuthResult> task) {

                                    if (task.isSuccessful()) {

                                        // Getting UID of Current User
                                        FirebaseUser current_user = mAuth.getCurrentUser();
                                        String UID = current_user.getUid();



                                        usersDB.child(UID).child("email").setValue(emailAdd);
                                        usersDB.child(UID).child("name").setValue(name);

                            Toast.makeText(youractivity.this, "Registeration done", Toast.LENGTH_SHORT).show();          

                                    } else {

                                        Toast.makeText(youractivity.this, "Registeration Failed", Toast.LENGTH_SHORT).show();
                                    }
                                }
                            });

                }