public class DonkyLocationController
extends AbstractLastLocation
| Modifier and Type | Method and Description |
|---|---|
void |
appStopped()
Handle if developer forgot to unregister locationUpdateListeners of location
|
static boolean |
checkGooglePlayServices(android.app.Activity activity) |
protected LocationRequest |
createLocationRequest() |
static DonkyLocationController |
getInstance() |
android.location.Location |
getLastLocation()
Get last user location
|
void |
init(android.content.Context context) |
boolean |
isShouldAutomaticallySendLocation() |
void |
onConnected(android.os.Bundle bundle) |
void |
onConnectionFailed(ConnectionResult connectionResult) |
void |
onConnectionSuspended(int i) |
void |
onLocationChanged(android.location.Location location)
Update observer about new data of location
|
void |
registerLocationListener(LocationUpdatesCallback callback)
Register location with default Location request
|
void |
registerLocationListener(LocationUpdatesCallback callback,
LocationRequest locationRequest)
Register with specific Location request
|
void |
requestUserLocation(TargetUser targetUser,
DonkyListener donkyListener)
Request location details from another user device.
|
void |
sendLocationUpdate(DonkyListener donkyListener)
Update device location on the Donky Network
|
void |
sendLocationUpdateToUser(TargetUser targetUser,
DonkyListener donkyListener)
Send your current location to another user on the Donky Network
|
void |
setPollingProfile(int interval,
int fastestInterval,
int priority,
int distanceTo) |
void |
setShouldAutomaticallySendLocation(boolean shouldAutomaticallySendLocation) |
void |
unregisterLocationListener(LocationUpdatesCallback callback)
Unregister from tracking location
|
public static DonkyLocationController getInstance()
public void init(android.content.Context context)
public void setPollingProfile(int interval,
int fastestInterval,
int priority,
int distanceTo)
protected LocationRequest createLocationRequest()
public android.location.Location getLastLocation()
public void registerLocationListener(LocationUpdatesCallback callback)
callback - to receive onLocationChange datapublic void registerLocationListener(LocationUpdatesCallback callback, LocationRequest locationRequest)
locationRequest - Location request to start tracking positioncallback - to receive onLocationChange datapublic void unregisterLocationListener(LocationUpdatesCallback callback)
callback - to remove from observerspublic void onConnected(android.os.Bundle bundle)
public void onConnectionSuspended(int i)
public void onConnectionFailed(ConnectionResult connectionResult)
public void onLocationChanged(android.location.Location location)
location - updated user's locationpublic void requestUserLocation(TargetUser targetUser, DonkyListener donkyListener)
TargetUser.getTargetUserByExternalId(String)
TargetUser.getTargetUserByExternalId(String, String)
TargetUser.getTargetUserByProfileId(String, String)
TargetUser.getTargetUserByProfileId(String)targetUser - Which user on the App Space should be asked to send you his locationdonkyListener - Callback for completing synchronisationpublic void sendLocationUpdate(DonkyListener donkyListener)
donkyListener - Callback for completing synchronisationpublic void sendLocationUpdateToUser(TargetUser targetUser, DonkyListener donkyListener)
targetUser - Which user on the App Space should be notified about your current locationdonkyListener - Callback for completing synchronisationpublic static boolean checkGooglePlayServices(android.app.Activity activity)
public void appStopped()
public boolean isShouldAutomaticallySendLocation()
public void setShouldAutomaticallySendLocation(boolean shouldAutomaticallySendLocation)