Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f2prateek/rx-receivers
Reactive Bindings for BroadcastReceivers — WIP
https://github.com/f2prateek/rx-receivers
Last synced: 1 day ago
JSON representation
Reactive Bindings for BroadcastReceivers — WIP
- Host: GitHub
- URL: https://github.com/f2prateek/rx-receivers
- Owner: f2prateek
- License: apache-2.0
- Created: 2015-09-06T03:13:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-09T05:49:09.000Z (over 7 years ago)
- Last Synced: 2024-11-09T20:10:58.287Z (9 days ago)
- Language: Java
- Homepage:
- Size: 89.8 KB
- Stars: 367
- Watchers: 12
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Rx Receivers
Reactive `BroadcastReceiver` implementations for Android.
*Note*: work in progress
### Usage
Register a `BroadcastReceiver` with the given `IntentFilter`, which emits `Intent` values:
```java
RxBroadcastReceiver.create(context, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION))
.subscribe((Action1) (intent) -> { textView.setText(intent.toString()); });
```Or use the pre-defined factory methods.
```java
RxTelephonyManager.phoneStateChanges(context).subscribe();
RxWifiManager.wifiStateChanges(context).subscribe();
RxWifiManager.networkStateChanges(context).subscribe();
RxWifiManager.supplicantConnectionChanges(context).subscribe();
RxWifiManager.supplicantStateChanges(context).subscribe();
```### Download
```groovy
compile 'com.f2prateek.rx.receivers:rx-receivers:0.1.0'
```### License
Copyright 2015 Prateek Srivastava
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 athttp://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.