Rx.network

Observe Android's CONNECTIVITY_CHANGE broadcasts using RxJava.
Alternatives To Rx.network
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Fast Android Networking5,536
23 days ago241apache-2.0Java
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀
Reactivenetwork2,508
754 months ago28September 17, 201936apache-2.0Java
Android library listening network connection state and Internet connectivity with RxJava Observables
Merlin548
a year ago1May 14, 2014otherJava
Observes network connection status & gives callbacks
Rxjava Mvp Giphy428
6 years ago2Java
Showcase of RxJava used with MVP and some other popular android libraries
Fountain174
2 years agomitKotlin
Android Kotlin paged endpoints made easy
Retrofit_rxjava_mvp131
6 years agoJava
Network uses Retrofit and RxJava With MVP architecture
Rxobservablediskcache89
6 years ago1otherJava
Simple NoSQL disk cache for network responses [STABLE]
Ethdroid47
5 years ago19mitJava
Easy-to-use Ethereum Geth wrapper for Android
Headlines46
4 years agoapache-2.0Kotlin
Simple Headlines app to showcase MVVM(Model-View-ViewModel) architecture with OFFLINE functionality in android.
Retrofit2rxjava Android Simples27
9 months agoJava
Retrofit2 + Rxjava +Cache 机制+EventBus,采用ButterKnife注解框架,包含Token失效处理方案,新增RxJava生命周期管理,mobile network 情况下缓存一分钟过期重新请求,wifi 情况下不使用缓存,none network 情况下直接读取缓存并离线缓存4周。
Alternatives To Rx.network
Select To Compare


Alternative Project Comparisons
Readme

Rx.Network

Release License

Listen for Android's CONNECTIVITY_CHANGE broadcasts.

Use

Add the ACCESS_NEWORK_STATE permission to AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Observing

This library exposes three different observables. They all monitor network connectivity the same way, but they provided varying levels of specificity about the state of the network.

Boolean

Use this observable when all you're interested in is knowing whether the network is connected or not.

	ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
    RxNetwork.connectivityChanges(this, connectivityManager)
        .subscribe(new Action1<Boolean>()
        {
            @Override
            public void call(Boolean connected)
            {
                // [...]
            }
        }

NetworkInfo.State

If you want just a little more information about the state of the network, but don't want to be weighed down by the minutia of things, then use this observable. Read NetworkInfo.State for more information about what you'll get back.

    ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
    RxNetwork.stateChanges(this, connectivityManager)
        .subscribe(new Action1<NetworkInfo.State>()
        {
            @Override
            public void call(NetworkInfo.State state)
            {
                // [...]
            }
        }

NetworkInfo.DetailedState

Here's the big daddy. This observable will tell you the "fine-grained" state of the network. Read NetworkInfo.DetailedState for more information about what you'll get back.

    ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
    RxNetwork.connectivityChanges(this, connectivityManager)
        .subscribe(new Action1<NetworkInfo.DetailedState>()
        {
            @Override
            public void call(NetworkInfo.DetailedState detailedState)
            {
                // [...]
            }
        }

Binaries

Add the JitPack repository to your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
   }

And then add this library to your project:

   dependencies {
        compile 'io.andref:Rx.Network:1.0.1'
   }

License

Copyright 2016 Michael De Soto

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.

Popular Rxjava Projects
Popular Network Projects
Popular Control Flow Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Network
Rxjava
Observables
Connectivity