Implementing password authentication on Android
To make things easier in terms of Android, we're going to use the awesome Firebase Auth UI. Using the Firebase Auth UI will save a lot of hassle when it comes to building the actual user interface and handling the different intent calls between the application activities. Let's see how we can integrate and use it for our needs.
Getting ready
Let's start first by configuring our project and downloading all the necessary dependencies. Head to your build.gradle
file and copy/paste the following entry:
compile 'com.firebaseui:firebase-ui-auth:3.0.0'
Now, simply sync and you will be good to start.
How to do it...
Now, let's see how we can make the functionality work:
- Declare the FirebaseAuth reference, plus add another variable that we will need later on:
FirebaseAuth auth; private static final int RC_SIGN_IN = 17;
- Now, inside your
onCreate
method, add the following code:
auth = FirebaseAuth.getInstance(); if(auth.getCurrentUser...