Difference between RxJava and RxAndroid?
Asked Answered
P

3

31

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.

Pluvious answered 4/4, 2018 at 12:38 Comment(0)
D
32

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.

Distrain answered 4/4, 2018 at 12:54 Comment(0)
E
12

RxAndroid does not replace rxjava. It is a small library of Android specific rxjava utilities. For example it makes the Android application main thread available as an rxjava scheduler.

Enactment answered 4/4, 2018 at 12:46 Comment(0)
M
2

The major difference between RxAndroid and RxJava is Schedulers. Schedulers are specifically available in RxAndroid not in RxJava which helps in efficient threading.

https://www.androidhive.info/RxJava/android-getting-started-with-reactive-programming/

Majorette answered 19/10, 2020 at 17:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.