{"id":13803555,"url":"https://github.com/pwittchen/ReactiveNetwork","last_synced_at":"2025-05-13T16:32:01.898Z","repository":{"id":36187927,"uuid":"40492118","full_name":"pwittchen/ReactiveNetwork","owner":"pwittchen","description":" Android library listening network connection state and Internet connectivity with RxJava Observables","archived":false,"fork":false,"pushed_at":"2025-01-06T11:09:52.000Z","size":1706,"stargazers_count":2533,"open_issues_count":38,"forks_count":271,"subscribers_count":63,"default_branch":"RxJava2.x","last_synced_at":"2025-04-28T13:58:41.998Z","etag":null,"topics":["android","internet","internet-connection","network","network-connection","network-monitoring","rxandroid","rxandroid2","rxjava","rxjava2","wifi"],"latest_commit_sha":null,"homepage":"http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pwittchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pwittchen"],"custom":["https://paypal.me/pwittchen"]}},"created_at":"2015-08-10T16:06:58.000Z","updated_at":"2025-04-01T06:29:24.000Z","dependencies_parsed_at":"2025-01-24T10:01:32.848Z","dependency_job_id":"d4025921-6282-4265-a0fe-aa995dae5b90","html_url":"https://github.com/pwittchen/ReactiveNetwork","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2FReactiveNetwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2FReactiveNetwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2FReactiveNetwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2FReactiveNetwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pwittchen","download_url":"https://codeload.github.com/pwittchen/ReactiveNetwork/tar.gz/refs/heads/RxJava2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981858,"owners_count":21994349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","internet","internet-connection","network","network-connection","network-monitoring","rxandroid","rxandroid2","rxjava","rxjava2","wifi"],"created_at":"2024-08-04T01:00:35.318Z","updated_at":"2025-05-13T16:32:00.414Z","avatar_url":"https://github.com/pwittchen.png","language":"Java","readme":"# ReactiveNetwork\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ReactiveNetwork-brightgreen.svg?style=flat-square)](https://android-arsenal.com/details/1/2290)\n\nview website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/)\n\nReactiveNetwork is an Android library listening **network connection state** and **Internet connectivity** with RxJava Observables. It's a successor of [Network Events](https://github.com/pwittchen/NetworkEvents) library rewritten with Reactive Programming approach. Library supports both new and legacy network monitoring strategies. Min sdk version = 9.\n\n| Current Branch | Branch  | Artifact Id | Build Status  | Coverage | Maven Central |\n|:--------------:|:-------:|:-----------:|:-------------:|:--------:|:-------------:|\n| | [`RxJava1.x`](https://github.com/pwittchen/ReactiveNetwork/tree/RxJava1.x) | `reactivenetwork` | [![Build Status for RxJava1.x](https://img.shields.io/travis/pwittchen/ReactiveNetwork/RxJava1.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/ReactiveNetwork) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/ReactiveNetwork/RxJava1.x.svg?style=flat-square\u0026label=coverage)](https://codecov.io/gh/pwittchen/ReactiveNetwork/branch/RxJava1.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork.svg?style=flat-square) |\n| :ballot_box_with_check: | [`RxJava2.x`](https://github.com/pwittchen/ReactiveNetwork/tree/RxJava2.x) | `reactivenetwork-rx2` | [![Build Status for RxJava2.x](https://img.shields.io/travis/pwittchen/ReactiveNetwork/RxJava2.x.svg?style=flat-square)](https://travis-ci.org/pwittchen/ReactiveNetwork) | [![codecov](https://img.shields.io/codecov/c/github/pwittchen/ReactiveNetwork/RxJava2.x.svg?style=flat-square\u0026label=coverage)](https://codecov.io/gh/pwittchen/ReactiveNetwork/branch/RxJava2.x) | ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork-rx2.svg?style=flat-square) |\n\nContents\n--------\n\n- [Usage](#usage)\n  - [Observing network connectivity](#observing-network-connectivity)\n    - [Connectivity class](#connectivity-class)\n    - [Network Observing Strategies](#network-observing-strategies)\n  - [Observing Internet connectivity](#observing-internet-connectivity)\n    - [Observing Internet connectivity continuously](#observing-internet-connectivity-continuously)\n    - [Checking Internet connectivity once](#checking-internet-connectivity-once)\n    - [Internet Observing Strategies](#internet-observing-strategies)\n    - [Custom host](#custom-host)\n  - [Chaining network and Internet connectivity streams](#chaining-network-and-internet-connectivity-streams)\n  - [ClearText traffic](#cleartext-traffic)\n- [Integration with other libraries](#integration-with-other-libraries)\n    - [Integration with OkHttp](#integration-with-okhttp)\n    - [Integration with Retrofit](#integration-with-retrofit)\n  - [ProGuard configuration](#proguard-configuration)\n- [Examples](#examples)\n- [Download](#download)\n- [Tests](#tests)\n- [Code style](#code-style)\n- [Static code analysis](#static-code-analysis)\n- [Who is using this library?](#who-is-using-this-library)\n- [Getting help](#getting-help)\n  - [Tutorials](#tutorials)\n- [Caveats](#caveats)\n- [Changelog](#changelog)\n- [JavaDoc](#javadoc)\n- [Documentation](#documentation)\n- [Releasing](#releasing)\n- [Contributors](#contributors)\n- [References](#references)\n  - [Mentions](#mentions)\n- [Supporters](#supporters)\n- [License](#license)\n\nUsage\n-----\n\n**Please note**: Due to memory leak in `WifiManager` reported\nin [issue 43945](https://code.google.com/p/android/issues/detail?id=43945) in Android issue tracker\nit's recommended to use Application Context instead of Activity Context.\n\n### Observing network connectivity\n\nWe can observe `Connectivity` with `observeNetworkConnectivity(context)` method in the following way:\n\n```java\nReactiveNetwork\n  .observeNetworkConnectivity(context)\n  .subscribeOn(Schedulers.io())\n  ... // anything else what you can do with RxJava\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(connectivity -\u003e {\n      // do something with connectivity\n      // you can call connectivity.state();\n      // connectivity.type(); or connectivity.toString();\n  });\n```\n\nWhen `Connectivity` changes, subscriber will be notified. `Connectivity` can change its state or type.\n\n**Errors** can be handled in the same manner as in all RxJava observables. For example:\n\n```java\nReactiveNetwork\n  .observeNetworkConnectivity(context)\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n       connectivity -\u003e /* handle connectivity here */,\n       throwable    -\u003e /* handle error here */\n   );\n```\n\nWe can react on a concrete state, states, type or types changes with the `filter(...)` method from RxJava, `hasState(NetworkInfo.State... states)` and `hasType(int... types)` methods located in `ConnectivityPredicate` class.\n\n```java\nReactiveNetwork\n  .observeNetworkConnectivity(context)\n  .subscribeOn(Schedulers.io())\n  .filter(ConnectivityPredicate.hasState(NetworkInfo.State.CONNECTED))\n  .filter(ConnectivityPredicate.hasType(ConnectivityManager.TYPE_WIFI))\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(connectivity -\u003e {\n      // do something\n  });\n```\n\n`observeNetworkConnectivity(context)` checks only connectivity with the network (not Internet) as it's based on `BroadcastReceiver` for API 20 and lower and uses `NetworkCallback` for API 21 and higher.\n Concrete WiFi or mobile network may be connected to the Internet (and usually is), but it doesn't have to.\n\nYou can also use method:\n\n```java\nObservable\u003cConnectivity\u003e observeNetworkConnectivity(Context context, NetworkObservingStrategy strategy)\n```\n\nThis method allows you to apply your own network observing strategy and is used by the library under the hood to determine appropriate strategy depending on the version of Android system.\n\n#### Connectivity class\n\n`Connectivity` class is used by `observeNetworkConnectivity(context)` and `observeNetworkConnectivity(context, networkObservingStrategy)` methods. It has the following API:\n\n```java\nConnectivity create()\nConnectivity create(Context context)\n\nNetworkInfo.State state()\nNetworkInfo.DetailedState detailedState()\nint type()\nint subType()\nboolean available()\nboolean failover()\nboolean roaming()\nString typeName()\nString subTypeName()\nString reason()\nString extraInfo()\n\n// and respective setters\n\nclass Builder\n```\n\n#### Network Observing Strategies\n\nRight now, we have the following strategies for different Android versions:\n- `LollipopNetworkObservingStrategy`\n- `MarshmallowNetworkObservingStrategy`\n- `PreLollipopNetworkObservingStrategy`\n\nAll of them implements `NetworkObservingStrategy` interface.\nConcrete strategy is chosen automatically depending on the Android version installed on the device.\nWith `observeNetworkConnectivity(context, strategy)` method we can use one of these strategies explicitly.\n\n### Observing Internet connectivity\n\n#### Observing Internet connectivity continuously\n\nWe can observe connectivity with the Internet continuously in the following way:\n\n```java\nReactiveNetwork\n  .observeInternetConnectivity()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnectedToInternet -\u003e {\n      // do something with isConnectedToInternet value\n  });\n```\n\nAn `Observable` will return `true` to the subscription (disposable) if device is connected to the Internet and `false` if not.\n\nInternet connectivity will be checked _as soon as possible_.\n\n**Please note**: This method is less efficient than `observeNetworkConnectivity(context)` method, because in default observing strategy, it opens socket connection with remote host (default is www.google.com) every two seconds with two seconds of timeout and consumes data transfer. Use this method if you really need it. Optionally, you can dispose subscription (disposable) right after you get notification that Internet is available and do the work you want in order to decrease network calls.\n\nMethods in this section should be used if they are really needed due to specific use cases.\n\nIf you want to customize observing of the Internet connectivity, you can use `InternetObservingSettings` class and its builder.\nThey allow to customize monitoring interval in milliseconds, host, port, timeout, initial monitoring interval, timeout, expected HTTP response code, error handler or whole observing strategy.\n\n```java\nInternetObservingSettings settings = InternetObservingSettings.builder()\n  .initialInterval(initialInterval)\n  .interval(interval)\n  .host(host)\n  .port(port)\n  .timeout(timeout)\n  .httpResponse(httpResponse)\n  .errorHandler(testErrorHandler)\n  .strategy(strategy)\n  .build();\n\nReactiveNetwork\n  .observeInternetConnectivity(settings)\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnectedToInternet -\u003e {\n      // do something with isConnectedToInternet value\n  });\n```\n\nThese methods are created to allow the users to fully customize the library and give them more control.\n\nPlease note, not all parameters are relevant for all strategies.\n\nFor more details check JavaDoc at: http://pwittchen.github.io/ReactiveNetwork/javadoc/RxJava2.x\n\n#### Checking Internet Connectivity once\n\nIf we don't want to observe Internet connectivity in the interval with `Observable\u003cBoolean\u003e observeInternetConnectivity(...)` method,\nwe can use `Single\u003cBoolean\u003e checkInternetConnectivity()`, which does the same thing, but **only once**.\nIt may be helpful in the specific use cases.\n\n```java\nSingle\u003cBoolean\u003e single = ReactiveNetwork.checkInternetConnectivity();\n\nsingle\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnectedToInternet -\u003e {\n      // do something with isConnectedToTheInternet\n  });\n```\n\nAs in the previous case, you can customize this feature with the `InternetObservingSettings` class and its builder.\n\n```java\nInternetObservingSettings settings = InternetObservingSettings.builder()\n  .initialInterval(initialInterval)\n  .interval(interval)\n  .host(host)\n  .port(port)\n  .timeout(timeout)\n  .httpResponse(httpResponse)\n  .errorHandler(testErrorHandler)\n  .strategy(strategy)\n  .build();\n\nSingle\u003cBoolean\u003e single = ReactiveNetwork.checkInternetConnectivity(settings);\n\nsingle\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnectedToInternet -\u003e {\n      // do something with isConnectedToTheInternet\n  });\n```\n\nBasic idea is the same. With just have `Single\u003cBoolean\u003e` return type instead of `Observable\u003cBoolean\u003e`\nand we don't have `int initialIntervalInMs` and `int intervalInMs` parameters.\n\nAs previously, these methods are created to allow the users to fully customize the library and give them more control.\n\nFor more details check JavaDoc at: http://pwittchen.github.io/ReactiveNetwork/javadoc/RxJava2.x\n\n#### Internet Observing Strategies\n\nRight now, we have the following strategies for observing Internet connectivity:\n- `SocketInternetObservingStrategy` -  monitors Internet connectivity via opening socket connection with the remote host\n- `WalledGardenInternetObservingStrategy` - opens connection with a remote host and respects countries in the Walled Garden (e.g. China)\n\nAll of these strategies implements `NetworkObservingStrategy` interface. Default strategy used right now is `WalledGardenInternetObservingStrategy`,\nbut with `checkInternetConnectivity(strategy)` and `observeInternetConnectivity(strategy)` method we can use one of these strategies explicitly.\n\n#### Custom host\n\nIf you want to ping custom host during checking Internet connectivity, it's recommended to use `SocketInternetObservingStrategy`.\nYou can do it as follows:\n\n```java\nInternetObservingSettings settings = InternetObservingSettings.builder()\n  .host(\"www.yourhost.com\")\n  .strategy(new SocketInternetObservingStrategy())\n  .build();\n\nReactiveNetwork\n  .observeInternetConnectivity(settings)\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnectedToHost -\u003e {\n      // do something with isConnectedToHost\n  });\n```\n\nIf you want to use `WalledGardenInternetObservingStrategy`, please update HTTP response code via `InternetObservingSettings`. E.g set it to `200` because default is `204`.\n\nThe same operation can be done with `checkInternetConnectivity(strategy, host)` method, which returns `Single` instead of `Observable`.\n\n### Chaining network and Internet connectivity streams\n\nLet's say we want to react on each network connectivity change and if we get connected to the network, then we want to check if that network is connected to the Internet. We can do it in the following way:\n\n```java\nReactiveNetwork\n  .observeNetworkConnectivity(getApplicationContext())\n  .flatMapSingle(connectivity -\u003e ReactiveNetwork.checkInternetConnectivity())\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(isConnected -\u003e {\n    // isConnected can be true or false\n});\n```\n\nIn case we're getting too many events related to the network changes or we want to discard previous observables (there's only one in the code snippet above) after subscribing them, we can use `switchMapSingle` operator instead of `flatMapSingle` in order to get the updates from the latest observable only. In this case, it will be observable created by `checkInternetConnectivity` method.\n\n### ClearText Traffic\n\nSometies, while trying to connect to the remote server we may encounter the following message:\n\n```\nClearText HTTP traffic not permitted\n```\n\nDue to this fact, observing Internet feature won't work properly.\n\nIt's related to [Network Security Configuration](https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted). Starting with Android 9.0 (API level 28), cleartext support is disabled by default.\n\nYou have a few options to solve this issue.\n\n**Option #1**\n\nCreate `res/xml/network_security_config.xml` file:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cnetwork-security-config\u003e\n    \u003cdomain-config cleartextTrafficPermitted=\"true\"\u003e\n        \u003cdomain includeSubdomains=\"true\"\u003eYour URL(ex: 127.0.0.1)\u003c/domain\u003e\n    \u003c/domain-config\u003e\n\u003c/network-security-config\u003e\n```\n\nLink it in your `AndroidManifest.xml` file:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmanifest ...\u003e\n    \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n    \u003capplication\n        ...\n        android:networkSecurityConfig=\"@xml/network_security_config\"\n        ...\u003e\n        ...\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n**Option #2**\n\nSet `usesCleartextTraffic` parameter in `\u003capplication\u003e` tag in `AndroidManifest.xml` file to `true`.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmanifest ...\u003e\n    \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n    \u003capplication\n        ...\n        android:usesCleartextTraffic=\"true\"\n        ...\u003e\n        ...\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\nFor more details, check Android documentation linked above or this StackOverflow thread: https://stackoverflow.com/a/50834600/1150795.\n\n### Integration with other libraries\n\nWe can integrate ReactiveNetwork with other libraries. Especially those, which support RxJava2. In this section, we can find examples showing how to integrate this library with the OkHttp and Retrofit.\n\n#### Integration with OkHttp\n\nIn order to integrate library with OkHttp, we need to wrap HTTP request with reactive type (e.g. `Observable`)\n\n```java\nprivate Observable\u003cResponse\u003e getResponse(String url) {\n  OkHttpClient client = new OkHttpClient();\n  Request request = new Request.Builder().url(url).build();\n\n  return Observable.create(emitter -\u003e {\n    try {\n        Response response = client.newCall(request).execute();\n        emitter.onNext(response);\n    } catch (IOException exception) {\n        emitter.onError(exception);\n    } finally {\n        emitter.onComplete();\n    }\n  });\n}\n```\n\nNext, we can chain two streams:\n\n```java\nReactiveNetwork\n   .observeNetworkConnectivity(getApplicationContext())\n   .flatMap(connectivity -\u003e {\n     if (connectivity.state() == NetworkInfo.State.CONNECTED) {\n       return getResponse(\"http://github.com\");\n     }\n     return Observable.error(() -\u003e new RuntimeException(\"not connected\"));\n   })\n   .subscribeOn(Schedulers.io())\n   .observeOn(AndroidSchedulers.mainThread())\n   .subscribe(\n       response  -\u003e /* handle response here */,\n       throwable -\u003e /* handle error here */)\n   );\n```\n\nIn the example above, whenever we get connected to the network, then request will be performed.\n\nFor more details regarding OkHttp, please visit its official website: http://square.github.io/okhttp/.\n\n#### Integration with Retrofit\n\nWe can integrate ReactiveNetwork with the Retrofit.\n\nFirst, we need to configure Retrofit:\n\n```java\nRetrofit retrofit = new Retrofit.Builder()\n   .baseUrl(\"https://api.github.com/\")\n   .addCallAdapterFactory(RxJava2CallAdapterFactory.create())\n   .addConverterFactory(GsonConverterFactory.create())\n   .build();\n```\n\nAs you see, we need `RxJava2CallAdapterFactory` here.\n\nNext, we need to define appropriate interface with RxJava `Single` types:\n\n```java\npublic interface GitHubService {\n @GET(\"users/{user}/repos\")\n Single\u003cList\u003cRepo\u003e\u003e listRepos(@Path(\"user\") String user);\n}\n```\n\nand instantiate the service:\n\n```java\nGitHubService service = retrofit.create(GitHubService.class);\n```\n\nNext, we want to call endpoint defined with the Retrofit whenever we get connected to the network. We can do it as follows:\n\n```java\nReactiveNetwork\n   .observeNetworkConnectivity(getApplicationContext())\n   .flatMapSingle(connectivity -\u003e service.listRepos(\"pwittchen\"))\n   .subscribeOn(Schedulers.io())\n   .observeOn(AndroidSchedulers.mainThread())\n   .subscribe(\n       repos     -\u003e /* handle repos here */,\n       throwable -\u003e /* handle error here */\n   );\n```\n\nFor more details regarding Retrofit, please visit its official website: http://square.github.io/retrofit/\n\n### ProGuard configuration\n\n```\n-dontwarn com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork\n-dontwarn io.reactivex.functions.Function\n-dontwarn rx.internal.util.**\n-dontwarn sun.misc.Unsafe\n```\n\nExamples\n--------\n\nExemplary application is located in `app` directory of this repository.\n\nIf you want to know, how to use this library with Kotlin, check `app-kotlin` directory.\n\nDownload\n--------\n\nYou can depend on the library through Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.pwittchen\u003c/groupId\u003e\n    \u003cartifactId\u003ereactivenetwork-rx2\u003c/artifactId\u003e\n    \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor through Gradle:\n\n```groovy\ndependencies {\n  implementation 'com.github.pwittchen:reactivenetwork-rx2:x.y.z'\n}\n```\n\n**Note #1**: Please, replace `x.y.z` with the **latest version number**, which is ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/reactivenetwork-rx2.svg?style=flat-square)\n\n**Note #2**: If you are using Gradle version lower than 3.0, replace `implementation` with `compile`\n\nTests\n-----\n\nTests are available in `library/src/test/java/` directory and can be executed on JVM without any emulator or Android device from Android Studio or CLI with the following command:\n\n```\n./gradlew test\n```\n\nTo generate test coverage report, run the following command:\n\n```\n./gradlew test jacocoTestReport\n```\n\nCode style\n----------\n\nCode style used in the project is called `SquareAndroid` from Java Code Styles repository by Square available at: https://github.com/square/java-code-styles.\n\nStatic code analysis\n--------------------\n\nStatic code analysis runs Checkstyle, PMD, Lint, ErrorProne and NullAway. It can be executed with command:\n\n ```\n ./gradlew check\n ```\n\nReports from analysis are generated in `library/build/reports/` directory.\n\nWho is using this library?\n--------------------------\n\nThese apps are using (or used) ReactiveNetwork library:\n- [SkyScanner Android app](https://play.google.com/store/apps/details?id=net.skyscanner.android.main)\n- [Slack Android app](https://play.google.com/store/apps/details?id=com.Slack)\n- [NextBike](https://play.google.com/store/apps/details?id=de.nextbike)\n- [PAT Track - realtime Tracker for the public transit in Pittsburgh, PA](https://play.google.com/store/apps/details?id=rectangledbmi.com.pittsburghrealtimetracker)\n- [Eero - Home WiFi System (acquired by Amazon)](https://play.google.com/store/apps/details?id=com.eero.android)\n- [ACN Android Framework](https://github.com/ugurcany/ACN-Android-Framework)\n- [Spatial Connect Android SDK](https://github.com/boundlessgeo/spatialconnect-android-sdk)\n- [Qiscus SDK for Android](https://github.com/qiscus/qiscus-sdk-android)\n- [Internet Radio](https://play.google.com/store/apps/details?id=com.stc.radio.player)\n- [Tachiyomi](https://github.com/inorichi/tachiyomi)\n- [Actinium - V2Ray client for Android](https://github.com/V2Ray-Android/Actinium)\n- [Project Bass - Android app](http://projectbass.org/)\n- [Movie Lovers](https://play.google.com/store/apps/details?id=com.mediaclient.movielovers.mobile)\n- [Waves Wallet](https://play.google.com/store/apps/details?id=com.wavesplatform.wallet)\n- [Fieldsight](https://github.com/fieldsight/fieldsight-mobile)\n- and more...\n\nAre you using this library in your app and want to be listed here? Send me a Pull Request or an e-mail to piotr@wittchen.io\n\nGetting help\n------------\n\nDo you need help related to using or configuring this library?\n\nYou can do the following things:\n- [Ask the question on StackOverflow](http://stackoverflow.com/questions/ask?tags=reactivenetwork)\n- [Create new GitHub issue](https://github.com/pwittchen/ReactiveNetwork/issues/new)\n\nDon't worry. Someone should help you with solving your problems.\n\n### Tutorials\n\nIf you speak Spanish (Español), check out this tutorial: [ReactiveNetwork - Como funciona y como se integra en una app](https://www.youtube.com/watch?v=H7xGmQaKPsI) made by [Video Tutorials Android](https://www.youtube.com/channel/UC2q5P9JVoA6N8mE622gRP7w).\n\nCaveats\n-------\n\nSince version **0.4.0**, functionality releated to **observing WiFi Access Points** and **WiFi signal strength (level)** is removed in favor of [ReactiveWiFi](https://github.com/pwittchen/ReactiveWiFi) library.\nIf you want to use this functionality, check [**ReactiveWiFi**](https://github.com/pwittchen/ReactiveWiFi) project.\n\nChangelog\n---------\n\nSee [CHANGELOG.md](https://github.com/pwittchen/ReactiveNetwork/blob/RxJava2.x/CHANGELOG.md) file.\n\nJavaDoc\n-------\n\nJavaDoc is available at: http://pwittchen.github.io/ReactiveNetwork/javadoc/RxJava2.x\n\nIt can be generated as follows:\n\n```\n./gradlew androidJavadocs\n```\n\nIn order to update JavaDoc on GitHub pages, use the following bash script:\n\n```\n./update_javadocs.sh\n```\n\nThen commit and push your changes to `gh-pages` branch.\n\nDocumentation\n--------------------------\n\nview website with documentation: [RxJava1.x](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava1.x/), [**RxJava2.x**](http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/)\n\nIt can be generated as follows:\n\nCopy the latest `README.md` file from `RxJava1.x` or `RxJava2.x` branch. Then checkout to `gh-pages` branch and put it into appropriate directory inside `docs/` directory.\n\nYou can do it as follows via bash script:\n\n```\n./update_docs.sh\ngit push\n```\n\nInstall docsify with the following command:\n\n```\nnpm i docsify-cli -g\n```\n\nGo into appropriate directory and type:\n\n```\ndocsify init .\n```\n\nRight now it's already generated, so we can just update the `README.md` file and adjust generated files manually.\n\nNext, we can just save changes, commit and push them to remote repository.\n\n\nReleasing\n---------\n\nSee [RELEASING.md](https://github.com/pwittchen/ReactiveNetwork/blob/RxJava2.x/RELEASING.md) file.\n\nContributors\n------------\n\n- [Piotr Wittchen](https://github.com/pwittchen) - project lead\n- [Tushar Acharya](https://github.com/tushar-acharya)\n- [Timothy Kist](https://github.com/Kisty)\n- [@dilongl](https://github.com/dilongl)\n- [@llp](https://github.com/llp)\n- [Adam Gabryś](https://github.com/agabrys)\n- [@lion4ik](https://github.com/lion4ik)\n- [@futtetennista](https://github.com/futtetennista)\n- [Manu Sridharan](https://github.com/msridhar)\n- [Alexander Perfilyev](https://github.com/aperfilyev)\n- [Vishesh Vadhera](https://github.com/VisheshVadhera)\n- [@ychescale9](https://github.com/ychescale9)\n\nReferences\n----------\n- [Android Documentation - Detect network changes, then change app behavior](https://developer.android.com/develop/quality-guidelines/building-for-billions-connectivity.html#network-behavior)\n- [Android Documentation - Provide onboarding experiences for users' network choices](https://developer.android.com/develop/quality-guidelines/building-for-billions-data-cost.html#configurablenetwork-onboarding)\n- [Android Documentation - Managing Network Usage](https://developer.android.com/training/basics/network-ops/managing.html)\n- [DroidCon Poland 2017 presentation slides - Is your app really connected?](https://speakerdeck.com/pwittchen/is-your-app-really-connected-1)\n- [Mobilization 2018 video recording - Is your app really connected?](https://www.youtube.com/watch?v=LDZjQ1dXgU4)\n- [RxJava](https://github.com/ReactiveX/RxJava)\n\n### Mentions\n- [Android Weekly #166](http://androidweekly.net/issues/issue-166)\n- [Android Weekly #289](http://androidweekly.net/issues/issue-289)\n- [Android Weekly China #44](http://www.androidweekly.cn/android-dev-weekly-issue44/)\n- [Android Arsenal #2290](https://android-arsenal.com/details/1/2290)\n- [GitHub Trending, 14th of Aug 2015](https://twitter.com/TrendingGithub/status/632117206801891328)\n- [TL DEV TECH - Best Android Libraries in 2017](http://www.tldevtech.com/best-android-libraries-2017/)\n- [TL DEV TECH - 30+ Best Android Libraries (2018)](https://www.tldevtech.com/best-android-libraries/)\n\nSupporters\n----------\n\nThanks for [JetBrains](https://www.jetbrains.com/?from=ReactiveNetwork) for sponsoring IntelliJ IDEA license for open-source development\n\n[![jetbrains logos](https://raw.githubusercontent.com/pwittchen/ReactiveNetwork/RxJava2.x/jetbrains_logo.png)](https://www.jetbrains.com/?from=ReactiveNetwork)\n\nLicense\n-------\n\n    Copyright 2016 Piotr Wittchen\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":["https://github.com/sponsors/pwittchen","https://paypal.me/pwittchen"],"categories":["Java","Rx","Bindings"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2FReactiveNetwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpwittchen%2FReactiveNetwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2FReactiveNetwork/lists"}