Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
1.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
blainepwnz committed Jan 8, 2019
1 parent dc9721b commit 097bd7c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 37 deletions.
59 changes: 24 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,24 @@ allprojects {
**Step 2.** Add the dependency

##### For Android studio 3.0
**Recommended**: This will use all libraries that you defined
**Recommended**: This will use all libraries that you defined
```
dependencies {
implementation 'com.android.support:appcompat-v7:YOUR_SUPPORT_LIBRARY_VERSION'
implementation 'com.android.support:design:YOUR_SUPPORT_LIBRARY_VERSION'
implementation 'io.reactivex.rxjava2:rxandroid:YOUR_RX_ANDROID_VERSION'
implementation 'io.reactivex.rxjava2:rxjava:YOUR_RX_JAVA_2_VERSION'
implementation 'com.google.android.gms:play-services-location:YOUR_GOOGLE_PLAY_VERSION'
implementation ('codes.titanium:locgetter:1.0.3',{
implementation ('codes.titanium:locgetter:1.1.0',{
transitive = false
})
}
```

```
**Not recommended:** This will use all dependencies from library, may increase apk size, increase methods count and lead to compile errors
```
dependencies {
implementation 'codes.titanium:locgetter:1.0.3'
implementation 'codes.titanium:locgetter:1.1.0'
}
```

#### For Android studio 2.3
**Recommended**: This will use all libraries that you defined
```
dependencies {
compile 'com.android.support:appcompat-v7:YOUR_SUPPORT_LIBRARY_VERSION'
compile 'com.android.support:design:YOUR_SUPPORT_LIBRARY_VERSION'
compile 'io.reactivex.rxjava2:rxandroid:YOUR_RX_ANDROID_VERSION'
compile 'io.reactivex.rxjava2:rxjava:YOUR_RX_JAVA_2_VERSION'
compile 'com.google.android.gms:play-services-location:YOUR_GOOGLE_PLAY_VERSION'
compile ('codes.titanium:locgetter:1.0.3',{
transitive = false
})
}
```
**Not recommended:** This will use all dependencies from library, may increase apk size, increase methods count and lead to compile errors
```
dependencies {
compile 'codes.titanium:locgetter:1.0.3'
}
```
```

Basic Usage
-----------
Expand All @@ -83,9 +60,8 @@ All you need is to create **LocationGetter** instance using **LocationGetterBuil

Optional you can add to builder:

* LocationRequest to customize location updates
* GoogleApiClient to use instance of your google api client
* Logger to get logs of everything happening inside LocationGetter
* Accept mock locations behavior

Start getting locations using one of methods for e.g.

Expand All @@ -99,17 +75,30 @@ locationGetter.getLatestLocation()

More examples can be found in sample package with sample app.

Helper activity
Error handling
---------------
You can extend your activity from **BaseLocationActivity** and get access to extended behavior with some features.
All exceptions are handled in library.

In case of no permissions -> user will be asked to give permissions, if user declines -> NoLocationPermission will be thrown

1. Catch exceptions via onLocationError to handle settings and permissions errors
2. Get callbacks with user locations permission granted/revoked and locations settings granted/revoke
3. Show dialog on google api available
In case of turned off location -> user will be asked to turn it on, if user declines -> LocationSettingsException will be thrown

Accept mock locations behavior
---
By default mock locations are accepted.
You can filter all mock locations that are received by location manager. Just set acceptMockLocations to false when you are building location getter.

In case if mock location will be received MockLocationException will be thrown with that mocked location and you can decide what to do with it.

Release notes
-------------
### 1.1.0
> * Major refactor
> * Removed a lot of redundant APIs
> * No more need of activity to handle exceptions
> * Optimizations
> * Feature - mock locations filter
### 1.0.3
> * Updated Readme
> * Updated dependencies bump
Expand Down
7 changes: 7 additions & 0 deletions bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ tasks.withType(Javadoc) {
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
tasks.whenTaskAdded { task ->
if (task.name == 'javadoc') {
task.configure {
failOnError false
}
}
}
android {
compileSdkVersion versions.compileSdkVersion
}
Expand Down
2 changes: 1 addition & 1 deletion deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext.versions = [
compileSdkVersion: 28,
minSdk: 16,
buildToolsVersion: '28.0.3',
publishVersion : '1.0.3',
publishVersion : '1.1.0',
buildCode : 4,
kotlinVersion : '1.3.11',
//libs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.titanium.locgetter.exception


class LocationSettingsException : RuntimeException()

0 comments on commit 097bd7c

Please sign in to comment.