public class PlayLocationManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private android.app.Activity |
activity |
private int |
intervalFastest |
private int |
intervalMax |
private java.util.ArrayList<PlayLocationListener> |
listeners |
private com.google.android.gms.location.FusedLocationProviderClient |
mFusedLocationClient |
private com.google.android.gms.location.LocationCallback |
mLocationCallback |
private com.google.android.gms.location.LocationRequest |
mLocationRequest |
| Constructor and Description |
|---|
PlayLocationManager(android.app.Activity activity,
PlayLocationListener... listeners)
Constructor for
PlayLocationManager |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PlayLocationListener listener)
Adds a listener to the listeners list
|
private boolean |
createClient()
Creates the client for location updates
|
private boolean |
googlePlayAPIAvailable()
Checks if googlePlayAPI is available or not
|
void |
setIntervals(int intervalMax,
int intervalFastest)
Sets the desired intervals.
|
void |
start()
Start method for starting the location updates.
|
private void |
startLocationUpdates()
Starts location updates
|
void |
stop()
Stop the client.
|
private com.google.android.gms.location.FusedLocationProviderClient mFusedLocationClient
private com.google.android.gms.location.LocationCallback mLocationCallback
private com.google.android.gms.location.LocationRequest mLocationRequest
private int intervalMax
private int intervalFastest
private android.app.Activity activity
private java.util.ArrayList<PlayLocationListener> listeners
public PlayLocationManager(android.app.Activity activity,
PlayLocationListener... listeners)
PlayLocationManageractivity - Current activitylisteners - Location listeners for parsing updates.public void setIntervals(int intervalMax,
int intervalFastest)
intervalMax - Max interval between location requests.intervalFastest - Fastest interval between two location requests.public void addListener(PlayLocationListener listener)
listener - Listener to be added.public void start()
public void stop()
private boolean googlePlayAPIAvailable()
private boolean createClient()
private void startLocationUpdates()
throws java.lang.SecurityException
java.lang.SecurityException - exception