Rolemodel app to be used as a base arch for a modern Android production app
- The app is 100% Kotlin with MVVM Architecture
- I use
Koin
which is a lightweight dependency injection framework to manage all dependencies. AndRxJava
for asynchronous work. I also useRetrofit
. - Layers
DataRepository
,ViewModel
,View
I'm using a simple arch of MVVM to achieve better separation of concerns, testability.
Simplicity of the codebase with Kotlin, the lightweight dependency injection framework Koin, simple structure, minimalist maintainable code approach.
Extensible for adding more features easily by hiding some of the logic in BaseClasses, also adding new modules Koin is easier than ever.
Testability with DI, it's easier to swap dependencies, mock and test ViewModels.
Error prone with Kotlin, RxJava onError and a base class for handling all possible exceptions, using a single view state with liveData to hold and survive orientation changes.
Showing meaningful error messages and tells the user to retry on errors.
- Do performance checks with LeakCanary and Android profiler.
- Use Koin DI in testing module.
- Add UI Espresso tests.
Compile the project with Gradle using
./gradlew build
- Foundation - Components for core system capabilities, and Kotlin extensions.
- AppCompat - Degrade gracefully on older versions of Android.
- Android KTX - Write more concise, idiomatic Kotlin code and helper functions for easy integration with coroutines.
- Architecture - A collection of libraries that help design robust, testable, and maintainable apps.
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying data changes.
- ViewModel - Store UI-related data that isn't destroyed on app rotations.
- Third party
- Glide for image loading.
- Koin a lightweight dependency injection framework to manage all dependencies.
- Retrofit a type-safe HTTP client for Android and Java.
- LoggingInterceptor to log web requests in a pretty way in logcat.
- RxJava for managing background threads.
- Leakcanary for tracing memory leaks.