All Projects → teachmind → RxAndroid-Examples

teachmind / RxAndroid-Examples

Licence: Apache-2.0 License
Learn RxJava by example

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RxAndroid-Examples

Traceur
Easier RxJava2 debugging with better stacktraces
Stars: ✭ 502 (+1468.75%)
Mutual labels:  rxjava2, rxjava-android
android-online-course
Android Online Course
Stars: ✭ 22 (-31.25%)
Mutual labels:  rxjava2, rxjava-android
Android Kotlin Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 615 (+1821.88%)
Mutual labels:  rxjava2, rxjava-android
Grox
Grox helps to maintain the state of Java / Android apps.
Stars: ✭ 336 (+950%)
Mutual labels:  rxjava2, rxjava-android
Rxjavapriorityscheduler
RxPS - RxJavaPriorityScheduler - A RxJava Priority Scheduler library for Android and Java applications
Stars: ✭ 138 (+331.25%)
Mutual labels:  rxjava2, rxjava-android
Rxcache
简单一步,缓存搞定。这是一个专用于 RxJava,解决 Android 中对任何 Observable 发出的结果做缓存处理的框架
Stars: ✭ 377 (+1078.13%)
Mutual labels:  rxjava2, rxjava-android
Rxdatabindings
RxJava2 extensions for Android Databindings library
Stars: ✭ 30 (-6.25%)
Mutual labels:  rxjava2, rxjava-android
RxRetroAPICall
API call example using Retrofit and RxJava2
Stars: ✭ 16 (-50%)
Mutual labels:  rxjava2, rxjava-android
Rxandroidexamples
RxJava and RxAndroid complete beginner examples
Stars: ✭ 117 (+265.63%)
Mutual labels:  rxjava2, rxjava-android
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (+212.5%)
Mutual labels:  rxjava2, rxjava-android
Freezer
A simple & fluent Android ORM, how can it be easier ? RxJava2 compatible
Stars: ✭ 326 (+918.75%)
Mutual labels:  rxjava2, rxjava-android
ObservableCache
Library for caching Observables during orientation change
Stars: ✭ 21 (-34.37%)
Mutual labels:  rxjava2, rxjava-android
Nybus
NYBus (RxBus) - A pub-sub library for Android and Java applications
Stars: ✭ 283 (+784.38%)
Mutual labels:  rxjava2, rxjava-android
Android Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 4,360 (+13525%)
Mutual labels:  rxjava2, rxjava-android
Rxanime
Visualizer to understand RxJava operators
Stars: ✭ 261 (+715.63%)
Mutual labels:  rxjava2, rxjava-android
Rxjava2 Operators Magician
你用不惯 RxJava,只因缺了这把钥匙 🔑 You are not used to RxJava, just because of the lack of this key.
Stars: ✭ 868 (+2612.5%)
Mutual labels:  rxjava2, rxjava-android
Rx.observe
Transform any method to an Rx Observable ! (VIPER)
Stars: ✭ 34 (+6.25%)
Mutual labels:  rxjava2, rxjava-android
RxKata
Learn Rx through Katas and exercises
Stars: ✭ 19 (-40.62%)
Mutual labels:  rxjava2, rxjava-android
AndroidVIP
Android project to experiment the VIPER approach using mosby, RxJava and dagger2
Stars: ✭ 21 (-34.37%)
Mutual labels:  rxjava2, rxjava-android
JsonPlaceholderApp
This was originally a code challenge for a company, but now is an example of MVI on Android.
Stars: ✭ 26 (-18.75%)
Mutual labels:  rxjava2

Learning RxJava for Android by example

This repository contains example of using RxJava with Android to solve real-world problems. More examples will be adding day by day and you are also welcome to contribute.

Examples

  1. Form validation
  2. Timer demo
  3. Two-way data binding
  4. Search implementation
  5. RestFul API call

1. Form validation (using combinelatest)

.combinelatest allows you to monitor the state of multiple observables at a single place. This example demonstrates the use of combinelatest to validate a basic form. In this example there are 3 input fileds for the form. The form will be valid if all those 3 fields are valid. If any input field is invalid, an error message will be shown against invalid input. We have 3 independent observables that observes the input changes. After an ecent is emited from all 3 inputs, the result is combined and the form is evaluated for validity.

Note that the form will evaluate only after each of those 3 inputs receives at least one event notification or text changes.

2. Timer demo (interval and delay)

This example shows how you can use RxJava's interval and delay operators to a bunch of cases where yo want to run a task at specific time inerval or after a specific time. This a better option than TimerTask. In the exapmle we have used interval operator to log a message after every 2s and delay operator is used for the same purpose but it starts after 10s.

3. Data binding for TextView (using PublishSubject)

Data binding is a pretty cool thing. It will auto update the view if the data source change. This example demonstrates how we can use PublishSubject to bind data with TextView. Here we have 2 EditText where we can enter two number and 1 TextView to show the sumation of those 2 numbers. The sumation will auto update if we change those numbers. This is a basic use of data binding. You can also use Presentation ViewModel pattern.

4. Search implementation

Search is a common feature of our daily using apps. It provides the content which we are looking for. We as a developer is responsible to implement in a better way to make it fast. This example will demonstrate how we can implement search feature with RxJava. It use Publish Subject to emit the events when user type to search. Debounce operator is used to execute the search task after a specific interval. Filter operator is used to avoid unknown search like empty search key and DistinctUntilChanged operator to avoid executing search task for the same key. It also use SwitchMap operator to avoid execute search task or network call which are no longer needed to display. Let's assume user is typing "a", "ab", "abc" then Publish Subject will emit event for each key total 3 events. But Debounce operator will wait for time interval then accept events available at that time and will pass it to Filter operator to check either empty or not. As key is changed than before like "ab"->"abc" DistinctUntilChanged operator will pass it to SwitchMap operator to avoid the previous search tesk or network call and process the latest search result.

5. RestFul API call

Now a days, most of the app need to retrieve data from remote server through web service or API. In this example we will get data from a web service and show it in app. As for network library we will use Retrofit. Retrofit will provide the response data as a observable so that we can easily process it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].