-
Notifications
You must be signed in to change notification settings - Fork 0
Home
RxAndroid adds the minimum classes to RxJava that make writing reactive components in Android applications easy and hassle-free.
Since it cannot provide every type of binding to Android in one place, a variety of third-party add-ons are available to fill in the gaps:
- RxLifecycle - Lifecycle handling APIs for Android apps using RxJava
- RxBinding - RxJava binding APIs for Android's UI widgets.
- SqlBrite - A lightweight wrapper around SQLiteOpenHelper and ContentResolver which introduces reactive stream semantics to queries.
- Android-ReactiveLocation - Library that wraps location play services API boilerplate with a reactive friendly API.
- rx-preferences - Reactive SharedPreferences for Android
- RxFit - Reactive Fitness API Library for Android
- RxWear - Reactive Wearable API Library for Android
- RxPermissions - Android runtime permissions powered by RxJava
- RxNotification - Easy way to register, remove and manage notifications using RxJava
- RxClipboard - RxJava binding APIs for Android clipboard.
-
RxBroadcast - RxJava bindings for
Broadcast
andLocalBroadcast
.
Note: this list is not for libraries which simply use RxJava to expose observables but for specifically those which aim to make interacting with Android APIs reactive.
The move from 0.25.0 to 1.x is a big one; here's an overview of what can be done (from here).
AndroidSchedulers
is all that remains in RxAndroid, though some method signatures have changed.
WidgetObservable
and ViewObservable
have been rolled into (and improved in) RxBinding.
LifecycleObservable
has been moved to RxLifecycle. In addition, they've gone through a fairly extensive behavior refactor, so make sure to check the changelogs.
ContentObservable.fromSharedPreferencesChanges()
has been moved (and improved) by rx-preferences.
The rest of ContentObservable
has yet to make the move. This could be a good project for someone looking to do some open source work!
ReactiveDialog
has not been moved to a new project.
AppObservable
and its bind methods have been completely eradicated. There were a number of problems with it:
- It tried to auto-unsubscribe, but it would only do so if the sequence emitted an item after the
Activity
orFragment
paused. As a consequence, sequences that never end might never unsubscribe. - It was designed to defend against notifications after pause, but it appears that bug only occurred due to a subtle logic issue in the
HandlerScheduler
. - It automatically called
observeOn(AndroidSchedulers.mainThread())
, whether you wanted it or not.
In other words: it didn't do what it claimed to do, it was overly defensive, and it had undesirable side effects.
When removing it, make sure to:
- Use manual
Subscription
handling (or RxLifecycle) to unsubscribe from the sequence properly. - Check whether you need to add
observeOn(AndroidSchedulers.mainThread())
to the sequence.