This is a simple event App using TicketMasterApi with pagination concepts using PagingLibrary with Jetpack Compose and Kotlin Coroutines + Flow.
- TicketMasterApi
- Kotlin
- Android Support Libraries
- Coroutine
- Koin
- Glide
- Retrofit
- OkHttp
- Gson
- Timber
- Mockito
- PagingLibrary
Here's how the sample project implements it:
Clean architecture encourages separation of concerns, making the code loosely coupled. This results in a more testable and flexible code. This approach divides the project in 3 modules: presentation, data and domain.
This is the User interface layer(Activities, Fragments and ViewModel) with the Android Framework, the MVVM pattern and the DI module.
This layer holds the business logic. Contains the use cases, in charge of calling the correct repository or data member.
This layer has the responsibility of selecting the proper data source for the domain layer. It contains the implementations of the repositories declared in the domain layer. This includes:
Remote Datasource:
: Handles communications with the remote API(REST or GRAPHQL). In this project, it makes ann HTTP call using Retrofit InterfaceCache Datasource
: Handles communication with the local storage which is used to cache the events data locallyEventPagedDatasource
: This class manages the actual loading of data for your list from the remote datasource. Since we have one key per page of Event API data, we extendPageKeyedDataSource
from the paging library. Finally, theEventPagedDataSource
will be created by its factory,AppPageDataSourceFactory
which inherits ofDataSource.Factory
I will be glad to answer any questions and also accept pull request if you find any issue.