How to create a Login Application on Android Studio?

Sukhbir Sekhon
10 min readFeb 2, 2020

--

In this tutorial, I will explain how to create a login application on Android Studio, which you can implement in any of your Android project.

Why an Authentication Application?

It is very crucial for every application to have some sort of authentication mechanism embedded into the project. Cyber security is becoming an important business requirement as well as necessity for big corporation. It doesn’t matter if you are starting a multi-billionaire project or your personal side project, you need an authentication system in your project to authenticate and track users.

Android Studio

Android Studio is an IDE for developing android application development just like any other IDE such as, Visual Studio, Eclipse, Netbeans, IntelliJ, XCode etc. Android Studio is popular for its fast and feature-rich emulator, which allows developers to run their code on multiple virtual phones and tablets. Android Studio has Github (version controlling), Firebase (database), and Google Cloud Platform (cloud service) which is very helpful while working on a project.

Create an Android Project

First and foremost, you need to download Android Studio. You can download Studio from here. Once you download it, you should see this screen to start a new project.

Start a new Android Studio Project.

There is an option to create a Login Activity, but we will customize our login application from scratch so that you can understand the role of each class individually. Select Empty Activity and lets begin our project!

Let’s name our application AuthenticationApp (you can name anything you want), choose Java as a language, and check ‘Use androidx.* artifacts’. Click Finish. You should see that main class (MainActivity) has been added for us.

Take a moment to review the files.

The most important file is app > java > com.example.authenticationapp > MainActivity

Run your app

You can either run on a real device or on an emulator. For the sake of this tutorial, go ahead and follow these steps to run your app on an emulator.

  • In Tools, click AVD Manager.
  • Select Create Virtual Device
  • Pick Pixel 2 as device from Phone category and select next.
  • Select Pie as a system image or OS and select next.
  • Keep the default settings and default AVD name.
  • Select Finish.
  • Click Run and you should see Hello World! screen on an emulator.

Congratulations! You are ready to start coding.

Login Application

Your project structure would look similar to this.

Create an empty activity name ‘Home’ under com.example.authenticationapp and add this code into it.

package com.example.authenticationapp;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class Home extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
public void login(View view){
startActivity(new Intent(getApplicationContext(),Login.class));
finish();
}

public void register(View view){
startActivity(new Intent(getApplicationContext(),Register.class));
finish();
}
}

We create two void methods for Login and Register button on Home page. These two methods would allow user to go to Register and Login page by clicking those buttons. Don’t worry if you receive errors, we will add Login and Register class later.

Now lets design front-end of our Home page. Add this code to your activity_home.xml file under res > layout

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/backgrounimage"
tools:context=".Home">

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Track360"
android:textColor="#0A0A0A"
android:textSize="36sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/btnHomeLogin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.812" />

<Button
android:id="@+id/btnHomeLogin"
android:layout_width="0dp"
android:layout_height="64dp"
android:layout_marginStart="100dp"
android:layout_marginLeft="100dp"
android:layout_marginEnd="100dp"
android:layout_marginRight="100dp"
android:background="#000000"
android:onClick="login"
android:text="Login"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/btnHomeRegister"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.906" />

<Button
android:id="@+id/btnHomeRegister"
android:layout_width="0dp"
android:layout_height="66dp"
android:layout_marginStart="100dp"
android:layout_marginLeft="100dp"
android:layout_marginEnd="100dp"
android:layout_marginRight="100dp"
android:layout_marginBottom="204dp"
android:background="#000000"
android:onClick="register"
android:text="Register"
android:textColor="#FFFFFF"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Now, lets add a background image of your choice.

  • Right click on drawable under res folder.
  • Click show in resource manager.
  • Click ‘+’ and import drawble.
  • You can select an image from your local machine and rename it ‘backgroundimage’.

Now you should have a back-end and front-end for home page. Those button would not work right now because we still have to add Login and Register classes. So lets add them.

Go ahead and create an empty activity with a name ‘Login’ and add this code into the file.

package com.example.authenticationapp;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

public class Login extends AppCompatActivity {
EditText mEmail,mPassword;
Button mLoginBtn;
TextView mCreateBtn, mHomeBtn;
ProgressBar progressBar;
FirebaseAuth fAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);

mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
progressBar = findViewById(R.id.progressBar);
fAuth = FirebaseAuth.getInstance();
mLoginBtn = findViewById(R.id.btnLogin);
mCreateBtn = findViewById(R.id.textRegister);
mHomeBtn = findViewById(R.id.txtHome);

mLoginBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

String email = mEmail.getText().toString().trim();
String password = mPassword.getText().toString().trim();

if(TextUtils.isEmpty(email)){
mEmail.setError("Email is Required.");
return;
}

if(TextUtils.isEmpty(password)){
mPassword.setError("Password is Required.");
return;
}

if(password.length() < 6){
mPassword.setError("Password Must be >= 6 Characters");
return;
}

progressBar.setVisibility(View.VISIBLE);

// authenticate the user

fAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Toast.makeText(Login.this, "Successfully Logged In", Toast.LENGTH_LONG).show();
// startActivity(new Intent(getApplicationContext(),MainActivity.class));
Intent intent = new Intent(Login.this, MainActivity.class);
startActivity(intent);

}else {
Toast.makeText(Login.this, "Error ! " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
}

}
});

}
});

mCreateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),Register.class));
}
});

mHomeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),Home.class));
}
});
}
}

There are a lot of things going on this class so let’s break this code into pieces and understand them individually.

Firstly, we need to set up a Firebase instance to set up a database for our users’ email and password.

  • Go to Tools tab and click Firebase.
  • Select ‘Save and retrieve data’ under Realtime Database.
  • Click on Connect to Firebase.
  • Create your google account and connect it to Firebase.
  • Now you can go to Firebase console and create a new project.
  • Now go to Authentication tab. You will see all the users stored here later in the project.

Go to Sign-In method tab and enable Email/Password. This will allow Firebase to authenticate users base on their email and password. There are multiple ways you can authenticate, but email and password is pretty common way to apply authentication.

In the Login class we are creating multiple variables store data in those variables.

EditText mEmail,mPassword;
Button mLoginBtn;
TextView mCreateBtn, mHomeBtn;
ProgressBar progressBar;
FirebaseAuth fAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
progressBar = findViewById(R.id.progressBar);
fAuth = FirebaseAuth.getInstance();
mLoginBtn = findViewById(R.id.btnLogin);
mCreateBtn = findViewById(R.id.textRegister);
mHomeBtn = findViewById(R.id.txtHome);

As you can see, mEmail and mPassword are the variable which will store text. mCreateBtn and mHomeBtn are buttons which redirect users to different page once user click on them.

Then we have mLoginBtn which complete the whole process of authenticating user because .setOnClickListener will start the process by validating email and password as shown below:

String email = mEmail.getText().toString().trim();
String password = mPassword.getText().toString().trim();

if(TextUtils.isEmpty(email)){
mEmail.setError("Email is Required.");
return;
}

if(TextUtils.isEmpty(password)){
mPassword.setError("Password is Required.");
return;
}

if(password.length() < 6){
mPassword.setError("Password Must be >= 6 Characters");
return;
}

Once it validate email and password, our Login page will display the progress bar, which represents that the process of logging in has been begun.

progressBar.setVisibility(View.VISIBLE);

We created a FirebaseAuth instance which will help us to authenticate users by calling the method name ‘.signInWithEmailAndPassword’ (another listener method). In this method, we are sending email and password to our Firebase console to check if this specific user exist in authentication database. If it does, then we will get SUCCESS response and the user will be redirected to our Homepage. If the user does not exist in our Firebase console authentication database then user will receive an error message and process will stop.

fAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Toast.makeText(Login.this, "Successfully Logged In", Toast.LENGTH_LONG).show();
// startActivity(new Intent(getApplicationContext(),MainActivity.class));
Intent intent = new Intent(Login.this, MainActivity.class);
startActivity(intent);

}else {
Toast.makeText(Login.this, "Error ! " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
}

}
});

When you will run this page, you will get an error message which will basically say that it cannot communicate with your firebase account because it doesn’t have permission to access internet. So let’s add a permission. Go to app > manifests > AndroidManifest.xml and add this code above <application> tag

<uses-permission android:name="android.permission.INTERNET" />

Now let’s design the front-end for our login page.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/backgroundimage"
tools:context=".Login">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Track360"
android:textAllCaps="false"
android:textColor="#000000"
android:textSize="45dp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.95" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:text="Log-In your account"
android:textColor="#000000"
android:textSize="24sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/email"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.49"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/email"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:layout_marginBottom="28dp"
android:background="#005E4A4A"
android:ems="10"
android:hint="Email"
android:inputType="textPersonName"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/phone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/phone"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:layout_marginBottom="68dp"
android:background="#005E4A4A"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/btnLogin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<Button
android:id="@+id/btnLogin"
android:layout_width="211dp"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:background="#000000"
android:text="Login"
android:textColor="#FFFFFF"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/textRegister"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<TextView
android:id="@+id/textRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="New Here? Create Account"
android:textAllCaps="false"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toBottomOf="@+id/txtHome"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<ProgressBar
android:id="@+id/progressBar2"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/txtHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="28dp"
android:text="Return to Home"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/progressBar2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

You are doing a great job! We just need to add our final Register page where user can create account. Let’s add emptyActivity and name it Register. Add this code into Register class

package com.example.authenticationapp;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

public class Register extends AppCompatActivity {
EditText mFullName, mEmail, mPassword, mPhone;
Button mRegisterBtn;
TextView mLoginBtn, mHomeBtn;
FirebaseAuth fAuth;
String userID;
ProgressBar progressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);

mFullName = findViewById(R.id.fullName);
mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
mPhone = findViewById(R.id.phone);
mRegisterBtn = findViewById(R.id.btnLogin);
mLoginBtn = findViewById(R.id.textRegister);
mHomeBtn = findViewById(R.id.homeText);

fAuth = FirebaseAuth.getInstance();
progressBar = findViewById(R.id.progressBar);

if(fAuth.getCurrentUser() != null){
startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
}

mRegisterBtn.setOnClickListener(new View.OnClickListener(){

@Override
public void onClick(View v) {
String email = mEmail.getText().toString().trim();
String password = mPassword.getText().toString().trim();

if(TextUtils.isEmpty(email)){
mEmail.setError("Email is required.");
return;
}

if(TextUtils.isEmpty(password)){
mPassword.setError("Password is required.");
return;
}

if(password.length() < 6){
mPassword.setError("Password must be greater or equals to 6 characters.");
}

progressBar.setVisibility(View.VISIBLE);

fAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {

@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
Toast.makeText(Register.this, "User Created.", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), MainActivity.class));

}
else{
Toast.makeText(Register.this, "Error ! " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
}
}
});
}
});
mLoginBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Login.class));
}
});
mHomeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Home.class));
}
});
}
}

Now let’s add front-end for the Register page

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/backgroungimage"
tools:context=".Register">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="Track360"
android:textAllCaps="false"
android:textColor="#000000"
android:textSize="36sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:text="Create New Account"
android:textColor="#000000"
android:textSize="24sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/fullName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/email"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:background="#00000000"
android:ems="10"
android:hint="Email"
android:inputType="textPersonName"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/phone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/phone"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:background="#00000000"
android:ems="10"
android:hint="Phone"
android:inputType="textPersonName"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/password"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<EditText
android:id="@+id/fullName"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:background="#00000000"
android:ems="10"
android:hint="Full Name"
android:inputType="textPersonName"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/email"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<EditText
android:id="@+id/password"
android:layout_width="379dp"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:background="#00000000"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:padding="10dp"
android:textColor="#000000"
android:textColorHint="#000000"
app:layout_constraintBottom_toTopOf="@+id/btnLogin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<Button
android:id="@+id/btnLogin"
android:layout_width="211dp"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:background="#000000"
android:text="Register"
android:textColor="#FFFFFF"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/textRegister"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<TextView
android:id="@+id/textRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="Already Registered? Login Here"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toBottomOf="@+id/homeText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />

<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/homeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="28dp"
android:text="Return to Home"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:fontFamily="@font/advent_pro_thin"
app:layout_constraintBottom_toTopOf="@+id/progressBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

You did it! Congratulations! Now lets run our app.

Home page
Login Page
Register page

If you go to your Firebase console, you can see all the register users along unique User UUID. You can delete the account and edit the credentials for your application users directly from Firebase console. If you notice that we are authenticating users based on their Phone number and Full name. Challenge yourself to authenticate users through their phone numbers and full name along their email and password. This is my challenge to you!

Well, I hope you learned something from this tutorial and I wish you best on your Android development journey. I am going to provide you an access to a full github repository for this project. If you get stuck then use this repository to troubleshoot your problem.

Github repository: authenticationApp

Good Luck!

--

--