In this post, I will teach you about the VIPER Architecture tutorial in Android Studio with the use of Kotlin.
Why the VIPER Architecture ?
if you are confused that why the VIPER Architecture we are using?. We can use other Architectures Like MVP, MVVM, or Clean Architecture.
Well, that’s completely up to you and your project requirements. There is no perfect architecture that is fit for all needs. Every architecture has more or less the same features and the most important thing is code separations for better understanding.
Project Intro
This project teaches you how to use the VIPER Architecture In Android using Kotlin.In this project we are using the themoviedb.org
Within the framework of an Android app, the VIPER layers are assigned according to the following scheme:
![Android VIPER Architecture Tutorial (Kotlin)](https://i0.wp.com/pankajjangid.com/wp-content/uploads/2020/12/68747470733a2f2f6b6f656e69672d6d656469612e72617977656e6465726c6963682e636f6d2f75706c6f6164732f323031382f30322f76697065722d736368656d652d343830783237332e706e67.png?resize=480%2C273&ssl=1)
Files description
Views
The View corresponds to an Activity or Fragment in the app. A goal is to make the View as dumb as possible, so that it only takes care of showing the UI.
SplashActivity
MainActivity
DetailActivity
PopularFragment
TopRatedFragment
UpcomingFragment
Interactor
The Interactor takes care of performing any action, when the Presenter says to.
PopularIntegrator
TopRatedIntegrator
UpcomingIntegrator
Presenter
The Presenter acts as a “Head-of-Department”. In other words, it commands any action making use of the Interactor, tells the View to display content, and orders the navigation to other screens using the Router.
SplashPresenter
MainPresenter
PopularPresenter
TopRatedPresenter
UpcomingPresenter
DetailPresenter
Entity
The Entity represents the app data. In short, it acts likes the Model in the MVP architecture pattern.
MoviesResponse
Router
The Router handles navigating to other screens during the app lifecycle. Every view has a router with in so please check the views.
These are the main components of VIPER Architecture. In this project we use the Fuel HTTP library and for persistence storage we are using the Room Database.