Skip to content

Example Android project using MVVM, DaggerAndroid, Jetpack, Data Binding, Retrofit, RxJava and Coroutines

License

Notifications You must be signed in to change notification settings

pushpalroymm/Praxis

 
 

Repository files navigation

Praxis

This is a sample app written in Kotlin following clean architecture principles which fetches random jokes and displays it.

The purpose of this app to showcase:

  • Implementation of Jetpack Android Architecture components with Dagger Android and Data Binding to minimize boilerplate code
  • Creation of proper components and Subcomponents using Dagger Android and their injection into Activity, Fragment, View Models and Helper Classes
  • Performing background task with Kotlin Coroutines

Languages, libraries and tools used

Architecture

Praxis follows the principles of Clean Architecture with Android Architecture Components.

Architecture's layers & boundaries:

Presentation Layer contains UI (Activities & Fragments) that are coordinated by ViewModels which execute 1 or multiple UseCases. Presentation Layer depends on Domain Layer.

Domain Layer is the most INNER part of the circle (no dependencies with other layers) and it contains Entities, Use cases & Repository Interfaces. Use cases combine data from 1 or multiple Repository Interfaces.

Data Layer contains Repository Implementations and 1 or multiple Data Sources. Repositories are responsible to coordinate data from the different Data Sources. Data Layer depends on Domain Layer.

Notes: Mapping between response models and transformed models will happen via extension functions defined in transformed model file

Conventions:

Files are suffixed with be defined Class types.

  • ViewModels are suffixed with VM. Ex: LoginVM
  • UseCases are suffixed with UseCase. Ex: LoginUseCase
  • Sources are suffixed with Source. Ex: LoginRemoteSource, LoginLocalSource
  • Repositories are suffixed with Repo. Ex: LoginRepo

Conclusion

This project can be used as a template for new apps. This project is continually evolving to integrate other libraries and techniques to keep it up to date.

About

Example Android project using MVVM, DaggerAndroid, Jetpack, Data Binding, Retrofit, RxJava and Coroutines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 99.3%
  • Shell 0.7%