Coroutines-MVVM-Koin-Example icon indicating copy to clipboard operation
Coroutines-MVVM-Koin-Example copied to clipboard

Android + MVVM + Coroutines Flow + Koin + Testing :heart:

Kotlin Gradle Mockk Retrofit Coroutines Coroutines-test OkHttp

This is an example of an Android App who uses coroutines flow to retrieve a list of https://jsonplaceholder.typicode.com/posts but retrieve the data one per one and be added to the RecyclerView.

V2

  • Add screen to see the detail of the post (you need to tap an item on the RecyclerView)
  • Update Gradle Version to 4.0.1 (you need Android Studio 4.0.1 or upper)
  • Update dependencies

V3 (working)

  • Change Layouts for Compose :)

ScreenShots

! !

Dependencies

References

  • Asynchronous development in Android: RxJava Vs. Kotlin Flow https://medium.com/makingtuenti/asynchronous-development-in-android-rxjava-vs-kotlin-flow-f7fdf2e2f81b

  • LiveData with Coroutines and Flow (Android Dev Summit '19) https://www.youtube.com/watch?v=B8ppnjGPAGE

  • Reactive scrabble benchmarks https://github.com/Kotlin/kotlinx.coroutines/blob/develop/benchmarks/src/jmh/kotlin/benchmarks/flow/scrabble/README.md

  • Unit-testing LiveData and other common observability problems https://medium.com/androiddevelopers/unit-testing-livedata-and-other-common-observability-problems-bb477262eb04

  • MVVM Testing w/Coroutines https://github.com/emedinaa/kotlin-mvvm/tree/coroutines?fbclid=IwAR1XZW4yr-LuwlOYnVIz_glvsNunsdvloMHq3-Y8iGTNL2F4fJxhLNGizSo

Contributors ✨


Carlos Ugaz


Jose Diaz