简体   繁体   English

如何在 Android 上使用带有电子邮件和密码的 firebase 登录

[英]How to use firebase login with email and password on Android

When I tried to follow the Firebase website for tutorial ( https://www.firebase.com/docs/web/guide/login/password.html ) on developing a simple login on android studio, I faced error, with red wiggly lines.当我尝试按照 Firebase 网站的教程 ( https://www.firebase.com/docs/web/guide/login/password.html ) 在 android studio 上开发一个简单的登录时,我遇到了错误,带有红色的摆动线.

Could someone help me or suggest a good place to learn about step by step tutorial on how to create a simple login using firebase.有人可以帮助我或建议一个好地方来学习有关如何使用 firebase 创建简单登录的分步教程。 Resources on firebase login for android are very limited online.用于 android 的 firebase 登录的资源在线非常有限。 Would be great if someone could help me .如果有人可以帮助我,那就太好了。

This is the code copied from firebase website for login, when I paste it into my code I have red error on email password function error UserData etc etc.这是从 firebase 网站复制的用于登录的代码,当我将其粘贴到我的代码中时,电子邮件密码功能错误 UserData 等出现红色错误。

   mRef.createUser({
            email    : "bobtony@firebase.com",
            password : "correcthorsebatterystaple"
    }, function(error, userData) {
        if (error) {
            console.log("Error creating user:", error);
        } else {
            console.log("Successfully created user account with uid:", userData.uid);
        }
    });
ref.createUser("bobtony@firebase.com", "correcthorsebatterystaple", new Firebase.ValueResultHandler<Map<String, Object>>() { @Override public void onSuccess(Map<String, Object> result) { System.out.println("Successfully created user account with uid: " + result.get("uid")); } @Override public void onError(FirebaseError firebaseError) { // there was an error }

很抱歉它在一条线上,我目前正在使用电话并且它不能很好地处理代码我从https://www.firebase.com/docs/android/guide/login/password.html获得了代码

As mentioned above Firebase has a library https://github.com/firebase/FirebaseUI-Android that has useful tools including login.如上所述,Firebase 有一个库https://github.com/firebase/FirebaseUI-Android ,其中包含有用的工具,包括登录。 Sounds like you went through the code lab posted by Frank van Puffelen.听起来你经历了 Frank van Puffelen 发布的代码实验室。

If it is helpful, I have been working on a project that uses their library but adds additional functionality like new user registration, saving user data (like the new users name) into your Firebase database, etc and with, hopefully, easy implementation.如果有帮助,我一直在开发一个项目,该项目使用他们的库,但添加了额外的功能,如新用户注册、将用户数据(如新用户名)保存到您的 Firebase 数据库等,并且希望能够轻松实现。 I have step by step instructions on how to add my code to your project with my base example the code added to a blank Android project.我有关于如何使用我的基本示例将我的代码添加到您的项目的分步说明,该代码添加到一个空白的 Android 项目。

The project includes Google Auth as well.该项目还包括 Google Auth。 https://github.com/cardenuto/FirebaseLogin https://github.com/cardenuto/FirebaseLogin

to login using firebase with username and password使用带有用户名和密码的 firebase 登录

 auth.signInWithEmailAndPassword(
    edt_username.text.toString().trim(),
    edt_password.text.toString().trim()
)
    .addOnCompleteListener(this) { task ->
        if (task.isSuccessful) {
            // Sign in success, update UI with the signed-in user's information
            Log.d("Status", "signInWithEmail:success")
            val user = auth.currentUser

            showAlert("User Logged-in Successfully ","Welcome :"+user)

        } else {
            // If sign in fails, display a message to the user.
            Log.w("Status", "signInWithEmail:failure", task.exception)
            showAlert("User not found ","Register")

        }

    }

http://www.androidcoding.in/2020/06/02/android-firebase-login-tutorial/ http://www.androidcoding.in/2020/06/02/android-firebase-login-tutorial/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自定义登录中的Firebase Android重置密码(不适用于电子邮件身份验证) - Firebase Android reset password in custom Login (not with email authentication) ionic -firebase 电子邮件和密码登录在 android 中不起作用 - ionic -firebase email& password login not working in android 如何在firebase中检查用户电子邮件和密码验证以登录 - How to check user email and password validation in firebase to login 如何限制Firebase电子邮件登录中的错误密码尝试? - How can i limit the wrong password attempts in Firebase email login? Android Firebase使用电子邮件和密码登录 - Android Firebase sign in with email and password Firebase电子邮件+密码登录事件未触发 - Firebase Email + Password login event not firing Android Kotlin:如何使用 hash 密码登录 - Android Kotlin: How to use hash password for login 如何使用解析创建带有电子邮件ID和密码的android登录活动? - How to create android Login activity with email id and password using parse? 如何将名称以及电子邮件和密码添加到Firebase数据库Android - How to add Name along with email and password to firebase database android 如何使用 email 和密码登录 firebase 管理员 sdk 在 ZE84E30B9390CDB464DB6DB2C9ABZ78 - How to sign in with email and password using firebase admin sdk in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM