Rx Android Examples


Source link: https://github.com/ravi8x/RxAndroidExamples

Here sample Rx Android Examples

Intro

The aim of this course is to teach fundamental concepts of RxJava and RxAndroid and take you from a novice to intermediate RxJava developer.

Head on to https://www.androidhive.info/RxJava for detailed explanation of RxJava modules.

Basics

  • Example1Activity - Basic Observable, Observer and Subscription example. Emitting list of animal names.
  • Example2Activity - Introduced Disposable to dispose the subscription.
  • Example3Activity - Introducing filter() operator to filter out the animal names starting with letter b.
  • Example4Activity - Example of chaining of operators. map() and filter() operators are used together.
  • Example5Activity - Introduced CompositeDisposable and DisposableObserver. Also custom data type Note is used in this example.

Operators

Read the Introduction to RxJava Operators to get started with RxJava operators.

  • JustOperator - Creating an Observable using just operator.
  • FromOperator - Creating an Observable using from operator.
  • RangeOperator - Creating an Observable using range operator.
  • BufferOperator - Buffer emits data into batches instead of emitting one at a time. Calculating number of taps in certain period is explained in the example.
  • DebounceOperator - Debounce operators emits items only when a specified timespan is passed. An example of taking search query is explained.
  • FilterOperator - filter allows the Observable to emit the only values those passes a test.
  • RepeatOperator - Creates an Observable that emits an item or series of items repeatedly.
  • SkipOperator - skip(n) operator skips the emission of first N items emitted by an Observable.
  • TakeOperator - take(n) takes first N emissions of an Observable.
  • DistinctOperator - Distinct operator filters out items emitted by an Observable by avoiding duplicate items in the list.
  • CountOperator - Counts number of items emitted by an Observable and emits only the count value.
  • ReduceOperator - Example of reduce operator. Applies a function to first item, takes the result and feeds back to same function on second item. This process continuous until the last emission. Once all the items are over, it emits the final result.
  • MaxOperator - Finds the maximum valued item in the Observable sequence and emits that value
  • MinOperator - Finds the minimum valued item in the Observable sequence and emits that value
  • SumOperator - Calculates the sum of all the items emitted by an Observable and emits only the Sum value.
  • AverageOperator - Calculates the average of all the items emitted by an Observable and emits only the Average value.
  • ConcatOperator - Concat operator combines output of two or more Observables into a single Observable. Maintains the order of execution.
  • MergeOperator - Merge also merges multiple Observables into a single Observable but it won’t maintain the sequential execution.
  • MapOperator - Map operator transform each item emitted by an Observable and emits the modified item.
  • FlatMapOperator - Example of FlatMap operator.
  • ConcatMapOperator - Example of ConcatMap operator.
  • SwitchMapOperator - Example of SwitchMap operator.
  • ZipOperator - Example of Zip operator.

Retrofit Networking

Android RxJava Networking with Retrofit, Gson RxJava networking using Retrofit library. An example of live Notes App is explained using Retrofit networking. Demo

Android Examples

Roadmap

  • RxBinding
  • RxJava Subjects
  • RxJava Event Bus
  • Understanding Marble Diagrams
  • Data Storage (SQLite, Room Persistence)
  • Flowable Backpressure Example
  • Hot vs Cold Observables
  • Side Effect Operators
  • Volley Networking
  • Form Validation
  • Rx Runtime Permissions
  • Timers & Intervals
  • Clean Architecture
  • MVP, MVVM Architecture
  • Complete RxJava Apps

Resources

Annotation-based library for generating runtime permissions dispatcher. It supports "Xiaomi" phone.

Simple wrapper library for acquiring 2Checkout payment gateway token.

RecyclerView snapping example with SnapHelper.

This tool generates an Android Parcelable implementation based on fields in the class.

IntelliJ IDEA / Android Studio plugin with some tools and usability improvements.

Android Studio / Eclipse ADT template for including icon resources from androidicons.com in your project.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes