mitchtabian / Open-API-Android-App

Kotlin, MVI, Hilt, Retrofit2, Coroutines, Room Persistence, REST API, Token Authentication
690 stars 230 forks source link
android-jetpack-components coroutines-android dagger2 jetpack-android jetpack-lifecycle-components jetpack-navigation kotlin mvvm-architecture navigation-component rest-api retrofit2 room-persistence

"Clean" Refactor Notes

In July 2021 I did a major refactor. Here's what I did:

  1. Migrate from Dagger to Hilt.
  2. Update Navigation Component.
  3. Decoupling.
    • Avoid sharing viewmodels. It makes unit testing easier when I can test fragments in isolation.
  4. Splitting business models into Entities and Dto's. This way I have a clear business model, network model, and caching model.
  5. Writing use cases.
    • Unidirectional data flow with MVI and kotlin sealed classes. (See Interactors)
  6. Refactor message handling system to a Queue.
  7. Migrate from Shared Preferences to DataStore.
  8. Migrate from Kotlin synthetics to ViewBinding.
  9. Write Unit tests for use-cases.

TODO

  1. Check out the new splash screen APIs
  2. Do a Compose refactor
    • I will create a new repo for this

Test Account

email: blake@tabian.ca

password: password


Powerful Android Apps with Jetpack Architecture

Watch the video course here: Powerful Android Apps with Jetpack Architecture.

In this course you'll learn to build a real application that interacts with the website open-api.xyz.

Open-api.xyz is a sandbox website for codingwithmitch members to practice interacting with a Rest API.


Prerequisites (Recommended not required):

  1. Dagger 2

  2. MVI Architecture

  3. Database Caching (Retrofit + Room)


What you'll learn: