kazaky / Search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rolemodel

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. And RxJava for asynchronous work. I also use Retrofit.
  • Layers DataRepository,ViewModel,View I'm using a simple arch of MVVM to achieve better separation of concerns, testability.

My approch

Simple

Simplicity of the codebase with Kotlin, the lightweight dependency injection framework Koin, simple structure, minimalist maintainable code approach.

Extensible

Extensible for adding more features easily by hiding some of the logic in BaseClasses, also adding new modules Koin is easier than ever.

Testable

Testability with DI, it's easier to swap dependencies, mock and test ViewModels.

Error prone

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.

Good UI/UX

Showing meaningful error messages and tells the user to retry on errors.

TODO

  • Do performance checks with LeakCanary and Android profiler.
  • Use Koin DI in testing module.
  • Add UI Espresso tests.

Build the Project

Compile the project with Gradle using

./gradlew build

Showcase [VIDEO]

Libraries used

  • 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.

About


Languages

Language:Kotlin 100.0%