Difference between RxJava and RxAndroid?

后端 未结 3 457
后悔当初
后悔当初 2021-01-07 17:03

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.

3条回答
  •  北海茫月
    2021-01-07 17:55

    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:

    Android specific bindings for RxJava 2.

    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.

    Note that when you're using RxAndroid, you should also use the latest RxJava version as a dependency:

    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.

提交回复
热议问题