This project involves three ways to encapsulate Retrofit + Kotlin Coroutines, each encapsulation idea is different.
Even if you are not familiar with the concatenation and Kotlin flow, you can get started quickly.
The purpose of the wrappers is to reduce boilerplate code and facilitate rapid development.
-
Encapsulation 1 (corresponding to branch oneWay) passes ui references, allowing deep ui customization according to the project, which is fast and convenient, but highly coupled (Google's recent architecture documentation no longer recommends using LiveData in the repository). Google's recent architecture documentation no longer recommends the use of LiveData in the Repository, this approach mainly provides a kind of encapsulation of ideas)
-
Encapsulation two (corresponding to branch master) is low coupling, few dependencies, but more template code.
-
Encapsulation 3 (corresponding to branch dev) aims to reduce boilerplate code, introduces the new flow stream programming, chaining calls, loading and network requests and result processing are all together, and in many cases don't even declare the LiveData/Flow objects.
According to the latest architecture of Google's official documentation, advancing the use of dev branches.
- Two ways to encapsulate Retrofit + concatenation for elegant and fast network requests
- Optimizing your web request framework with Kotlin Flow to reduce boilerplate code
Some of the ideas of the project come from other open source projects, thanks to other authors for their selfless contributions.
The project debugging Api comes from wanandroid of Hongyang God, thanks for providing free and stable api.
I hope we can have a harmonious and friendly communication to build an open source community.
Translated with DeepL