GithubHelp home page GithubHelp logo

chevalx / rxjava2-android-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amitshekhariitbhu/rxjava2-android-samples

0.0 0.0 0.0 494 KB

RxJava 2 Android Examples - How to use RxJava 2 in Android

Home Page: https://amitshekhar.me

License: Apache License 2.0

Java 100.00%

rxjava2-android-samples's Introduction

Learning RxJava 2 for Android by example

This project is for :

  • who is migrating to RxJava 2
  • or just started with RxJava.

About me

Hi, I am Amit Shekhar, I have mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.

You can connect with me on:

My Personal Blog - amitshekhar.me - High-quality content to learn Android concepts.

Just Build the project and start learning RxJava by examples.

RxJava 2.0 has been completely rewritten from scratch on top of the Reactive-Streams specification. The specification itself has evolved out of RxJava 1.x and provides a common baseline for reactive systems and libraries.

Using RxJava 2.0 Library in your application

Add this in your build.gradle

compile 'io.reactivex.rxjava2:rxjava:X.X.X'

If you are using RxAndroid also, then add the following

compile 'io.reactivex.rxjava2:rxandroid:X.X.X'

RxJava 2 Operators Examples present in this sample project:

  • Map -> transform the items emitted by an Observable by applying a function to each item. Blog: RxJava Operator Map vs FlatMap
  • Zip -> combine the emissions of multiple Observables together via a specified function and emit single items for each combination based on the results of this function
  • Filter -> emit only those items from an Observable that pass a predicate test
  • FlatMap -> transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable. Blog: RxJava Operator Map vs FlatMap
  • Take -> emit only the first n items emitted by an Observable. Blog for reference
  • Reduce -> apply a function to each item emitted by an Observable, sequentially, and emit the final value
  • Skip -> suppress the first n items emitted by an Observable
  • Buffer -> periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a time
  • Concat -> emit the emissions from two or more Observables without interleaving them. Blog for reference
  • Replay -> ensure that all observers see the same sequence of emitted items, even if they subscribe after the Observable has begun emitting items
  • Merge -> combine multiple Observables into one by merging their emissions
  • SwitchMap -> transform the items emitted by an Observable into Observables, and mirror those items emitted by the most-recently transformed Observable

Highlights of the examples :

Find this project useful ? ❤️

  • Support it by clicking the ⭐ button on the upper right of this page. ✌️

Thanks

Amit Shekhar

You can connect with me on:

Read all of my blogs here.

License

   Copyright (C) 2022 Amit Shekhar

   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.

Contributing to RxJava 2 Android Samples

Just make pull request. You are in!

rxjava2-android-samples's People

Contributors

amadeu01 avatar amitshekhariitbhu avatar anandgaurav10 avatar ankitpagalguy avatar bapspatil avatar d00mch avatar insomniatt avatar ivanlepi avatar kykrueger avatar milkbiscuit avatar moshenskyi avatar redstartgong avatar roman-yu avatar sdsyjh avatar vignesh150493 avatar werockstar avatar wind0ws avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.