https://github.com/malekkamel/rxgps
https://github.com/malekkamel/rxgps
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/malekkamel/rxgps
- Owner: MalekKamel
- Created: 2018-08-30T21:45:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T05:12:50.000Z (almost 7 years ago)
- Last Synced: 2025-04-22T18:11:38.817Z (6 months ago)
- Language: Java
- Size: 258 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RxGps
### RxJava wrapper for Android LocationSettingsRequest used to enable GPS.
#### If you tried to enable GPS before, you'll find it a complex task and encounter many problems. One of these problems is ` ResolvableApiException` which you must handle in your onActivityResult(). As a result you'll spread your logic everywhere!
# The Clean Solution
##### Using RxLocationSettingsRequest you just write few lines of code and all the work will be done for you!```java
LocationRequest locationRequest = new ...
new RxGps()
.enable(locationRequest, MainActivity.this) // FragmentActivity
.subscribe(isLocationRequested -> {
if (isLocationRequested){
// Location is now enabled and you can implement your logic of
// location safely
}
});
```# Installation
[  ](https://bintray.com/shabankamel/android/rxlocationsettingsrequest/_latestVersion)
```groovy
dependencies {
implementation 'com.sha.kamel:rx-location-settings-request:1.0.4@aar'
}allprojects {
repositories {
maven { url "https://dl.bintray.com/shabankamel/android" }
}
}
```### See 'app' module for the full code.
# License
## Apache license 2.0