Firebase SDK: Authentication using email/password
In our previous sections, we have learned how authentication is done using Firebase UI either for email/password or email link/no password. In this section, we will learn how the Firebase SDK is used for authentication. Firebase SDK is slightly the same as Firebase UI. Let’s see the steps for implementing email/password authentication using Firebase SDK.
Step1:
In the first step, we have to perform the preliminary steps, which are as follows:
- Creating an Android project.
- Creating a Firebase project.
- Adding Firebase to the Android project or application, either manually or Firebase Assistance.
- Adding the required libraries and JSON files.
- Enable email/password sign-in method in Firebase console.
Step 2:
After performing the preliminary steps, we will create a register, login, and sign-out activities.
Step 3:
In the next step, we will code for register activity. The code is as follows:
Register
Step 4:
After that, we will code for login and sign-out activity, respectively. The codes are as follows
Login
Sign-out
Output: