RxJava on Github

a library for composing asynchronous and event-based programs by using observable sequences.

A library running on the Java VM that uses observable sequences to compose asynchronous, event-based programs. (Excuse my limited English)

Rxjava making address: https://github.com/ReactiveX/RxJava

Rxandroid making address: https://github.com/ReactiveX/RxAndroid

Why did we choose RXJava compared to other technologies??

Observable and Subscriber can do anything:

1.Observable can be a network request or Subscriber to display the request result;

2.Observable can be a database query, Subscriber to display query results;

Observable can be button click event or Subscriber to respond to click event.

4.Observable can be a load and parse of large picture files, Subscriber can display the parsed picture.

This article, the first in a series of articles, shows you the API for creating an Observable without further ado.

Create:





Observable.create

just:





Observable.just

from:





Observable.from

Just vs. FROM: Just shoots the array once as an entire object, whereas FROM shoots each object in the array once, meaning multiple shoots.

Defer:





Observable.defer

Defer allows you to create an Observable until an observer subscribes, and to create a new Observable for each observer

Interval:





Observable.interval

Interval creates an Observable that emits integer sequences at fixed intervals

timer:





Observable.timer

The Timer creates an Observable that emits a special value after a given delay

range:





Observable.range

Range creates an Observable that emits a particular sequence of integers, an ordered sequence of integers in a range, where you can specify the start and length of the range

repeat:





Observable.repeat

Repeat creates an Observable that emits a particular data multiple times

Conclusion:

The above methods provide basic examples of RxJava API for creating Observable objects.

Note: I will add the GitHub source address at the end of this series, so stay tuned…