After searching about android architecture components I realized that MVVM is better than other architectures at some points so I started to learn MVVM and I'm using Kotlin language but the problem is when I search for tutorials to start learning I found many components like RxJava, RxAndroid, Dagger2, Room, Lifecycle and etc. but they don't say why they are using them and why they choose some specific components. i will show you some examples :

1- Android MVVM with Dagger2, Retrofit, RxJava

2- Android MVVM with Dagger2, Retrofit, RxAndroid

3- Android app with MVVM dagger2 RxJava Livedata and Room

我的问题是:

1- How should I decide to choose some of these components and work with them?

2- How should I know that I need to use some of them together(for example Livedata and RxJava)?

这让我很困惑,我不知道如何开始.

推荐答案

First you need to individually understand why to use Kotlin, MVVM, Dagger, RxJava, Retrofit.

MVVM and Kotlin:

https://medium.com/@zhangqichuan/android-development-with-mvvm-and-kotlin-9598c3623ce1

RxJava and RxAndroid:

RxAndroid是RxJava(用于处理线程和异步任务)的扩展,有关更多详细信息,请查看以下链接:

Retrofit:

https://medium.com/@elye.project/kotlin-and-retrofit-2-tutorial-with-working-codes-333a4422a890

LiveData and room with kotlin:

Room是SQLite数据库之上的数据库层,用于在从本地SQLite数据库获取数据 timeshift 除boilter板,请使用以下链接:

在分别理解这些组件(Kotlin、MVVM、Dagger、RxJava和RxAndroid、改型、LiveData)之后,您需要在单个项目中完成所有这些事情,请使用以下链接:

https://github.com/egek92/Kotlin-MVVM-LiveData-Room

Kotlin相关问答推荐

只能在元素区域中点击的Jetpack Compose列

等待下一个值时暂停Kotlin Coroutine

Regex(Kotlin)仅匹配句子末尾的句号,而忽略中间的句号,如缩写

如何在Kotlin中为接受varargs的函数添加带有默认值的新参数?

有没有一种简单的方法来识别物体?

合并状态流

通过快捷键手动砍掉功能参数等

使用 kotlin 流删除 map 中具有某些相似性的值

使用 Jetpack Compose 使用参数导航

在 kotlin 原始字符串中转义三重引号

即使 Kotlin 的 `Map` 不是 `Iterable`,它如何以及为什么是可迭代的?

异常传播如何在 CoroutineScope.async 上工作?

下拉通知面板时是否可以暂停Android中的任何视频(媒体播放器)应用程序?

jetpack compose 将参数传递给 viewModel

使用 Kotlin 创建新目录,Mkdir() 不起作用

防止导航到同一个片段

无法在Kotlin中使用argb color int值?

如何在特定条件下清除jetpack数据存储数据

使用导航组件在不同的图形之间导航

使用 java lambda 调用 kotlin 函数时,Kotlin 无法访问 kotlin.jvm.functions.Function1