RxJava和RxAndroid之间的区别? [英] Difference between RxJava and RxAndroid?
问题描述
为什么我们需要将RxAndroid与RxJava一起使用?它们与RxAndroid和RxJava的实际使用之间的功能区别是什么?我找不到合适的答案.
Why do we need to use RxAndroid with RxJava? What is the functional difference between them and actual use of RxAndroid and RxJava? I can't find proper answer for this.
推荐答案
RxAndroid
可理解为 RxJava
的扩展,可帮助您在Android平台上使用它容易地.请参见 RxAndroid Github存储库上的说明:
RxAndroid
can be understood as an extension to RxJava
, that helps you to use it on Android platform easily. See the description on RxAndroid Github repository:
RxJava 2的Android特定绑定.
Android specific bindings for RxJava 2.
此模块将最小的类添加到RxJava中以进行编写Android应用程序中的反应性组件既简单又轻松.更多的具体来说,它提供了一个计划程序,可以在主程序上进行计划.线程或任何给定的Looper.
This module adds the minimum classes to RxJava that make writing reactive components in Android applications easy and hassle-free. More specifically, it provides a Scheduler that schedules on the main thread or any given Looper.
请注意,当您使用 RxAndroid
时,还应该使用最新的 RxJava
版本作为依赖项:
Note that when you're using RxAndroid
, you should also use the latest RxJava
version as a dependency:
由于RxAndroid版本很少,建议您也明确依赖RxJava的最新版本进行错误修复和新功能.
Because RxAndroid releases are few and far between, it is recommended you also explicitly depend on RxJava's latest version for bug fixes and new features.
这篇关于RxJava和RxAndroid之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!