Android's Rxjava function response Programming (i) Basic usage __div

Source: Internet
Author: User

First, brief

For many developers today, functional response programming has become an essential way to compute-oriented abstraction, which describes a job search for expressions, and response programming is a data-flow programming paradigm that is related to the updating of data, The combination of thinking and responsive programming in functional programming is a function-responsive programming, and we step into the inner part of the function-responsive programming. Before understanding Rxjava, we should know what Rx is,rxjava is reactivex Java implementation, Microsoft defines RX as a function library that allows developers to write asynchronous and event-based programs using observable sequences and LINQ -style query operators, and developers can leverage observables To represent the concurrent processing of asynchronous data streams, querying asynchronous streams with LINQ style query operators, and schedulers parameterized asynchronous data streams; Rxjava asynchronous operations are implemented through the observer pattern, and Rxjava has four roles, respectively Observable,Observer,Subscribler,suject, observable, and observer implement subscription relationships through Subscribler , the observable can notify the observer when needed;

second, the basic use of Rxjava

Before using, configure the Androidstudio Gradle

dependencies {
    ...
    .. Compile ' io.reactivex.rxjava2:rxjavafx:2.2.0 '
    compile ' io.reactivex:rxandroid:1.2.1 '
}

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.