public class LocationTool
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addGeofence(GeofencingRequest request) |
void |
addGeofence(GeofencingRequest request,
android.app.PendingIntent pendingIntent) |
void |
cancelAllWeakLocationUpdates() |
boolean |
cancelLocationUpdates(LocationListener locationListener) |
static boolean |
checkGpsPermission(android.app.Activity activity) |
static boolean |
checkLocationPermission(android.app.Activity activity) |
static LocationTool |
getInstance() |
android.location.Location |
getLastLocation() |
static boolean |
isGpsEnabled(android.content.Context context) |
static boolean |
isLocationEnabled(android.content.Context context) |
void |
removeGeofences(java.util.List<java.lang.String> fencesIds) |
void |
removeGeofences(android.app.PendingIntent pendingIntent) |
void |
removeGeofencesWithDefaultPendingIntent() |
static void |
requestGpsPermission(android.app.Activity activity,
int requestCode) |
static void |
requestGpsPermission(android.support.v4.app.Fragment fragment,
int requestCode) |
static void |
requestGpsPermission(android.app.Fragment fragment,
int requestCode) |
void |
requestLocationUpdates(LocationRequest locationRequest,
LocationListener locationListener) |
void |
requestLocationUpdates(LocationRequest locationRequest,
LocationListener locationListener,
UpdateType updateType) |
void |
setGeofencingPendingIntent(android.app.PendingIntent pendingIntent) |
void |
start()
Start location service.
|
void |
start(ConnectionListener listener)
Start location service.
|
void |
stop()
Used to stop getting location updates.
|
public static LocationTool getInstance()
public void start()
public void start(ConnectionListener listener)
public void stop()
public void requestLocationUpdates(LocationRequest locationRequest,
LocationListener locationListener)
CoreLocationTool.requestLocationUpdates(LocationRequest, LocationListener, UpdateType)public void requestLocationUpdates(LocationRequest locationRequest,
LocationListener locationListener,
UpdateType updateType)
CoreLocationTool.requestLocationUpdates(LocationRequest, LocationListener, UpdateType)public boolean cancelLocationUpdates(LocationListener locationListener)
CoreLocationTool.cancelLocationUpdates(LocationListener)public void cancelAllWeakLocationUpdates()
CoreLocationTool.cancelAllWeakLocationUpdates()public android.location.Location getLastLocation()
CoreLocationTool.getLastLocation()public void setGeofencingPendingIntent(android.app.PendingIntent pendingIntent)
public void addGeofence(GeofencingRequest request,
android.app.PendingIntent pendingIntent)
public void addGeofence(GeofencingRequest request)
public void removeGeofences(java.util.List<java.lang.String> fencesIds)
public void removeGeofencesWithDefaultPendingIntent()
public void removeGeofences(android.app.PendingIntent pendingIntent)
public static boolean isGpsEnabled(android.content.Context context)
public static boolean isLocationEnabled(android.content.Context context)
public static void requestGpsPermission(android.app.Activity activity,
int requestCode)
public static void requestGpsPermission(android.app.Fragment fragment,
int requestCode)
public static void requestGpsPermission(android.support.v4.app.Fragment fragment,
int requestCode)
public static boolean checkGpsPermission(android.app.Activity activity)
public static boolean checkLocationPermission(android.app.Activity activity)