public class ReactiveLocationProvider
extends java.lang.Object
| Constructor and Description |
|---|
ReactiveLocationProvider(android.content.Context ctx) |
| Modifier and Type | Method and Description |
|---|---|
<any> |
addGeofences(android.app.PendingIntent geofenceTransitionPendingIntent,
GeofencingRequest request)
Creates observable that adds request and completes when the action is done.
|
<any> |
getDetectedActivity(int detectIntervalMiliseconds)
Observable that can be used to observe activity provided by Actity Recognition mechanism.
|
<any> |
getGeocodeObservable(double lat,
double lng,
int maxResults)
Creates obserbable that translates latitude and longitude to list of possible addresses using
included Geocoder class.
|
<any> |
getLastKnownLocation()
Creates observable that obtains last known location and than completes.
|
<any> |
getUpdatedLocation(LocationRequest locationRequest)
Creates observable that allows to observe infinite stream of location updates.
|
<any> |
removeGeofences(java.util.List<java.lang.String> requestIds)
Observable that can be used to remove geofences from LocationClient.
|
<any> |
removeGeofences(android.app.PendingIntent pendingIntent)
Observable that can be used to remove geofences from LocationClient.
|
public ReactiveLocationProvider(android.content.Context ctx)
public <any> getLastKnownLocation()
com.google.android.gms.location.FusedLocationProviderApi#getLastLocation(com.google.android.gms.common.api.GoogleApiClient) ()} docs.
Observable can report LocationConnectionException
when there are trouble connecting with Google Play Services and other exceptions that
can be thrown on com.google.android.gms.location.FusedLocationProviderApi#getLastLocation(com.google.android.gms.common.api.GoogleApiClient).
Everything is delivered by rx.Observer#onError(Throwable).public <any> getUpdatedLocation(LocationRequest locationRequest)
LocationConnectionException
when there are trouble connecting with Google Play Services and other exceptions that
can be thrown on com.google.android.gms.location.FusedLocationProviderApi#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener).
Everything is delivered by rx.Observer#onError(Throwable).locationRequest - request object with info about what kind of location you needpublic <any> getGeocodeObservable(double lat,
double lng,
int maxResults)
lat - latitudelng - longitudemaxResults - maximal number of results you are interested inpublic <any> addGeofences(android.app.PendingIntent geofenceTransitionPendingIntent,
GeofencingRequest request)
LocationConnectionException
when there are trouble connecting with Google Play Services.
The AddGeofenceException is
reported only on com.google.android.gms.location.LocationStatusCodes#ERROR. Every other
status is included in AddGeofenceResult.
Other exceptions will be reported that can be thrown on com.google.android.gms.location.GeofencingApi#addGeofences(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.GeofencingRequest, android.app.PendingIntent)
Every exception is delivered by rx.Observer#onError(Throwable).geofenceTransitionPendingIntent - pending intent to register on geofence transitionrequest - list of request to addpublic <any> removeGeofences(android.app.PendingIntent pendingIntent)
RemoveGeofencesException is
reported only on com.google.android.gms.location.LocationStatusCodes#ERROR. Every other
status is included in RemoveGeofencesResult.
Other exceptions will be reported that can be thrown on com.google.android.gms.location.GeofencingApi#removeGeofences(com.google.android.gms.common.api.GoogleApiClient, android.app.PendingIntent).
Every exception is delivered by rx.Observer#onError(Throwable).pendingIntent - key of registered geofencespublic <any> removeGeofences(java.util.List<java.lang.String> requestIds)
RemoveGeofencesException is
reported only on com.google.android.gms.location.LocationStatusCodes#ERROR. Every other
status is included in RemoveGeofencesResult.
Other exceptions will be reported that can be thrown on com.google.android.gms.location.GeofencingApi#removeGeofences(com.google.android.gms.common.api.GoogleApiClient, java.util.List).
Every exception is delivered by rx.Observer#onError(Throwable).requestIds - geofences to removepublic <any> getDetectedActivity(int detectIntervalMiliseconds)
detectIntervalMiliseconds - detecion interval