This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade instructions for 1.x to 2.0 (#113)
* Add upgrade instructions for 1.x to 2.0 * Add permission requirements
- Loading branch information
1 parent
d47b09e
commit 626792e
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#Upgrading from Lost 1.x | ||
|
||
##Add Connection Callbacks | ||
Lost 2.0 introduces an underlying `Service` in the `FusedLocationProviderApi`. Because of this, connecting a `LostApiClient` requires that developers add `ConnectionCallbacks` so that they know when the client has connected and is ready to use. | ||
|
||
1.x: | ||
```java | ||
LostApiClient client = new LostApiClient.Builder(context).addConnectionCallbacks(callbacks).build(); | ||
client.connect(); //Client is ready for use | ||
``` | ||
|
||
2.0: | ||
```java | ||
LostApiClient.ConnectionCallbacks callbacks = new LostApiClient.ConnectionCallbacks() { | ||
@Override public void onConnected() { | ||
//Client is ready for use | ||
} | ||
|
||
@Override public void onConnectionSuspended() { | ||
|
||
} | ||
}; | ||
LostApiClient client = new LostApiClient.Builder(context).addConnectionCallbacks(callbacks).build(); | ||
client.connect(); //Client is NOT ready for use | ||
``` | ||
|
||
##Explicitly Request Permissions | ||
We have removed permissions from Lost's manifest, allowing developers to declare only the permissions they need in their client applications. In addition, developers also need to request and check for runtime permissions. | ||
|
||
The permissions that Lost requires are as follows: | ||
|
||
###FusedLocationProviderApi & GeofencingApi | ||
```xml | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | ||
``` | ||
|
||
###SettingsApi | ||
```xml | ||
<uses-permission android:name="android.permission.BLUETOOTH"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> | ||
``` |