Hi everyone, welcome to MVVM Login Example Android Tutorial.
An authentication system is required in almost any kind of application. You name any application, Facebook, WhatsApp, Ola, Uber and you will find an Authentication System there.
Most commonly used authentication method is the email and password authentication, that we see almost everywhere. And in this post we will learn implementing a proper authentication system for our android project.
Table of Contents
How Authentication Works in Android?
As we already know, android is kind of FRONT-END technology. And we do not authenticate the user on the app side. We need some kind of backend where we can authenticate our users.
This diagram explains how authentication happens in the android application.
Now we need a backend that will actually authenticate our application’s user. So before moving ahead you need to check this Building Login API with OAuth2 Tutorial.
For this post I am assuming that you already have your backend API ready.
What is MVVM?
We know how Authentication works. Now let’s understand “What is MVVM?”.
MVVM or Model-View-ViewModel is an architectural pattern.
I already have a complete Step by Step guide that explains about MVVM. So before moving ahead, you can check the Android MVVM Tutorial first; and if you are already aware of it, just skip this step.
MVVM Login Example Android
After completing all the above pre requisites, finally you can make an android project to implement the Authentication.
The following playlist will cover about building a proper Login System in your android project with MVVM architecture.
You will learn the following in the above playlist:Â
- Designing Android Login Screen and Signup Scree.
- Using ViewDataBinding for Designs.
- Setting Up Retrofit Client for making network requests.
- Using Coroutines for Asynchronous Function Calls.
- Following MVVM Architecture with Repository Pattern for the Project.
MVVM Login Example Source Code
You also have the access of the Source Code of the project. My recommendation is don’t get the source code First.
First you need to try on your own, follow the video lessons and try to do it yourself.
In case you are facing an issue, then only go to the source code for reference.