Baike.dev
All toolsTrendingOpen sourceNewsSubmit
Log in
< 返回工具列表
R

RxAndroid

> 编程语言
开源

RxJava bindings for Android

20.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

RxJava bindings for Android

# RxAndroid: Reactive Extensions for Android Android specific bindings for [RxJava 3](http://github.com/ReactiveX/RxJava). 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`. ## Communication Since RxAndroid is part of the RxJava family the communication channels are similar: - Google Group: [RxJava][list] - Twitter: [@RxJava][twitter] - StackOverflow: [rx-android][so] - [GitHub Issues][issues] # Binaries ```groovy dependencies { implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' // 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. // (see https://github.com/ReactiveX/RxJava/releases for latest 3.x.x version) implementation 'io.reactivex.rxjava3:rxjava:3.1.5' } ``` * RxAndroid: * RxJava: Additional binaries and dependency information for can be found at [search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.reactivex.rxjava3%22%20a%3A%22rxandroid%22). Snapshots of the development version are available in Sonatype's snapshots repository.

```groovy repositories { mavenCentral() maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } dependencies { implementation 'io.reactivex.rxjava3:rxandroid:3.1.0-SNAPSHOT' } ```

## Build To build: ```bash $ git clone [email protected]:ReactiveX/RxAndroid.git $ cd RxAndroid/ $ ./gradlew build ``` Further details on building can be found on the RxJava [Getting Started][start] page of the wiki. # Sample usage A sample project which provides runnable code examples that demonstrate uses of the classes in this project is available in the `sample-app/` folder. ## Observing on the main thread One of the most common operations when dealing with asynchronous tasks on Android is to observe the task's result or outcome on the main thread. Using vanilla Android, this would typically be accomplished with an `AsyncTask`. With RxJava instead you would declare your `Observable` to be observed on the main thread: ```java Observable.just("one", "two", "three", "four", "five") .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(/* an Observer */); ``` This will execute the `Observable` on a new thread, and emit results through `onNext` on the main thread. ## Observing on arbitrary loopers The previous sample is merely a specialization of a more general concept: binding asynchronous communication to an Android message loop, or `Looper`. In order to observe an `Observable` on an arbitrary `Looper`, create an associated `Scheduler` by calling `AndroidSchedulers.from`: ```java Looper backgroundLooper = // ... Observable.just("one", "two", "three", "four", "five") .observeOn(AndroidSchedulers.from(backgroundLooper)) .subscribe(/* an Observer */) ``` This will execute the Observable on a new thread and emit results through `onNext` on whatever thread is running `backgroundLooper`. ## Bugs and Feedback For bugs, feature requests, and discussion please use [GitHub Issues][issues]. For general usage questions please use the [mailing list][list] or [StackOverflow][so]. ## LICENSE Copyright 2015 The RxAndroid authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. [list]: http://groups.google.com/d/forum/rxjava [so]: http://stackoverflow.com/questions/tagged/rx-android [twitter]: http://twitter.com/RxJava [issues]: https://github.com/ReactiveX/RxAndroid/issues [start]: https://github.com/ReactiveX/RxJava/wiki/Getting-Started

核心特点

  • •Google Group: [RxJava][list]
  • •Twitter: [@RxJava][twitter]
  • •StackOverflow: [rx-android][so]
  • •[GitHub Issues][issues]
  • •RxAndroid: <a href='http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.reactivex.rxjava3%22%20a%3A%22rxandroid%22'></a>
  • •RxJava: <a href='http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.reactivex.rxjava3%22%20a%3A%22rxjava%22'></a>

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月9日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

  • Home
  • All tools
  • Trending
  • Open source

About

  • About us
  • Community
  • News

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools