Before I knew there was Rxjava this thing, know this thing is very dick, but also stop to look at the title, see a few paragraph introduction of the degree (lazy cancer hairenbujian).This week on the whim, the time to take the previous collection of the Rxjava of the Big God wrote the primer on the article read.
http://gank.io/post/560e15be2dca930e00da1083
Spent the night watching, by the way
RxJava development skills 8-seamless integration with REST-RxJava and Retrofit
In this chapter, we will create a final versionReal worldIn this example, retroing data to remote APIs with Retrofit asynchronously queries data, thus creating a rich UI with no effort.Project objectives
We will create a newActivity. ThisActivityThe StackExchange API will be used to retrieve the most active 10 users from stackove
compose (). FlatMap () has many uses and this is not one of the them.
Referenced from: http://blog.danlew.net/2015/03/02/dont-break-the-chain/To put it simply:1, compose is affecting the entire stream, and Flatmap is only the part that affects its own transformation.2. Flatmap is executed after calling next (), while compose is executed directly.3, Flatmap in next () after the execution will create a observable object (for the next operation to form
The original is from "RxJava Essentials"
Original Author: Ivan Morgillo
Development technology Front www.devtf.cn
Reprint statement: This translation has authorized developers to enjoy the exclusive right to reprint, without permission, not reproduced!
Translator: Yuxingxin
Project Address: RXJAVA-ESSENTIALS-CN
RX-from. NET to RxjavaResponsive programming is a programming
[Android development experience] replacing AsyncTask and AsyncTaskLoader-RxJava Android templates with RxJava. Observable, androidasynctask
Reprinted please indicate the source http://blog.csdn.net/zhaokaiqiang1992
Welcome to the ndroid-tech-frontier open-source project, and regularly translate foreign Android high-quality technologies, open-source libraries, software architecture design, testing, and o
data structures.2. A function that receives the data structure generated by the first function and the data emitted by the source observable as a parameter.Let's use the reduce and collect operators. As with the original scan example, we created the source observable using a list of 10 numbers 2.private observable
return observable.from
(list ). reduce ((x, y) x * y) ; } private observabl
Reactivex/rxjava Document Chinese versionProject Address: Https://github.com/mcxiaoke/RxDocs, Welcome to star and help improve.Have any comments or suggestions, come here to Create New IssueRead the Address
Reactivex document Chinese Translation
Pdf/epub/mobi format Download
Description
Most are translated from Reactivex.io and RxJava Wiki, fixed some errors in the original text,
The original is from "RxJava Essentials"
Original Author: Ivan Morgillo
Development technology Front www.devtf.cn
Reprint statement: This translation has authorized developers to enjoy the exclusive right to reproduce the headlines, without permission, not reproduced!
Translator: Yuxingxin
Project Address: RXJAVA-ESSENTIALS-CN
RX-from. NET to RxjavaResponsive programming i
As more and more people begin to mention RxJava, given the current hot and mysterious status of RxJava, write this article to RxJava a relatively detailed introduction to Android developers.The purpose of this article is two: 1. For people interested in RxJava some introductory guidelines
(Observer)Subscriber is an abstract implementation of the observer interface, and it is recommended to use subscriber, which in fact Rxjava Subscibe into a observer during the subscriber process.
Final subscriber@Overridepublic void oncompleted () {LOG.D (TAG, "oncompleted ()");}@Overridepublic void OnError (Throwable e) {LOG.D (TAG, "OnError () e=" + e);}@Overridepublic void OnNext (String s) {LOG.D (TAG, "OnNext () data=" + s);}}
ObjectiveI have read a few about Rxjava source analysis of the blog, I do not know whether my level is limited or the source is too profound, resulting in a long time to figure out its operating principle. I personally think there should be a better way to quickly analyze the understanding, so decided to write this article.This article is suitable has already seen some Rxjava source analysis material school
, it onError() is triggered, the queue is automatically terminated, and no more events are allowed to be emitted.
In a correctly-run sequence of events, onCompleted() and onError() there is only one, and is the last in the sequence of events. It is important to note that the onCompleted() onError() two are also mutually exclusive, that is, one is called in the queue, and the other should not be called again.
RxJava's observer pattern is roughly as follows:
1. PrefaceThis article is based on the use of Rxjava, retrofit, if the Rxjava or retrofit do not understand the Jianyo can first understand the Rxjava, retrofit usage and then see this article.The use of Rxjava and retrofit was described separately before this article:
Use of Android Retrofit 2.0
Use of An
memory leaks.So it's a good idea to keep the principle of calling unsubscribe () as soon as possible in the right place (such as OnPause () OnStop (), and so on) when no longer in use,To prevent memory leaks from occurring.//2) Create observableObservable observable = Observable.create (new observable.onsubscribe @Overridepublic void Call (SUBSCRIBERSubscriber.onnext ("Hello");Subscriber.onnext ("Hi");Subscriber.onnext ("Aloha");Subscriber.oncomplete
the event's creator, subscriber is the consumer of the event.Observable is responsible for generating data, subscriber responsible for consumption data.The operator in the middle is responsible for data conversion.Be proficient in the use of projects.Five. Class diagram1. There are 4 main characters in Rxjava:? Observable? Subject? Observer? SubscriberObservable and subject are two "production" entities, and observer and Subscriber are two "consumpti
transformation operators are common in Rxjava:I'll cover each of these operators in more detail below.Note: This article only explains the transformation operators commonly used by RXJAVA2 in the development process.3. Application scenario corresponding operator introductionNext, I'll explain the transformation operators in RXJAVA2Note: Before using the Rxjava 2 operator, remember to add dependencies in t
Rxjava used for nearly half a year, and now more and more inseparable from the library, from the use to gradually touch it behind the realization, suddenly want to write something about Rxjava content. In the brewing of how to organize content, go to see their own collection of Rxjava, found full of dry goods!1. Parabola: RxJ
(System. out::p rintln). Filter(Prime, Prime%2==0). Doonnext(System. out::p rintln). Count(). Doonnext(System. out::p rintln). Map(Number-String. Format("Contains%d elements", number));Subscription Subscription = O. Subscribe(System. out::p rintln, System. out::p rintln, () System. out. println("completed!"));Here is the output of the code:233557711114Contains4elementsCompleted! In this way you can collect valuable information about how the Observ
with Retrofit
Probably the most complete RxJava in the old hemisphere. Summary of Usage scenarios
Rxjava Combat
Android Retrofit 2.0 Use-Supplemental article
Project
Rxjavasamples
Rxjava-android-samples
Video
Android developers are sure to like the RxJava
Simplifying HTT
Rxjava and rxandroid a basic use
1. Rxjava Project Address
Https://github.com/ReactiveX/RxJava
2. Rxandroid Project Address
Https://github.com/ReactiveX/RxAndroid
3, the relationship between Rxjava and rxandroid
Rxandroid is an extension of the Android platform for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.