Clean architecture in Android (Jetpack Compose, Paging 3.0, Kotlin, MVVM) ーPart- 2
--
Nowadays Clean architecture is an essential part of Android development. So I believe every developer should know about it. I won't talk much about the importance and details of Clean architecture. Because this is the second part of this series. We will use this GitHub repository. If you did not read the previous part I suggest taking a look.
Show Me what we are Reading
It is a great app. Isn’t it?
You always talk Too much
Ok ok. Let’s start. First, we will see what is new in this part.
- Improved design (Or maybe deterioration 😃)
- Movie Details Screen
- Paging 3.0
- ROOM DB
TL;DR
- Add local data source (ROOM DB)in the
data
layer - Add paging and
RemoteMediator
indata
layer - Add use case in
domain
layer to interact - Modify
MovieRemoteDataSourceImpl
to add paging and caching.
Adding ROOM DB
I think there is no introduction needed for ROOM DB 😃. I think it is a widely used Local database in android. We have added DB in data
the module. Here all the DB-related operations will happen.
In MovieDao
All the MovieTable
related functionality will happen. In the getAllMovies()
the function returns PagingSource
which is used for paging.