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:
LostApiClient client = new LostApiClient.Builder(context).addConnectionCallbacks(callbacks).build();
client.connect(); // Client is ready for use
2.0:
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
We have removed all permissions from Lost's AndroidManifest.xml
, allowing developers to declare only the permissions they need in their client applications.
In addition, developers targeting Android M (API 23) and above also need to request runtime permissions.
The permissions that Lost requires are as follows:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>