public class LocationGpsListener
extends java.lang.Object
LocationListener
Constructor and Description |
---|
LocationGpsListener(Device device) |
LocationGpsListener(DeviceLocation deviceLocation) |
Modifier and Type | Method and Description |
---|---|
void |
disableLocationListener()
Disable location listener
|
void |
enableLocationService(Context context,
int timeWait,
int minDist)
Enable location service with GPS provider
|
int |
getLimitPeriodToControlBetterLocation() |
static boolean |
isBetterLocation(Location location,
Location currentBestLocation,
int limitPeriodInMiliseconds)
Source code modified basing in the Android's documentation
Determines whether one Location reading is better than the current Location fix
|
boolean |
isGpsEnable()
verify if GPS is enable
|
void |
onLocationChanged(Location location)
Called when the location has changed.
|
void |
onProviderDisabled(java.lang.String provider)
not implemented
|
void |
onProviderEnabled(java.lang.String provider)
not implemented
|
void |
onStatusChanged(java.lang.String provider,
int status,
Bundle extras)
not implemented
|
void |
setLimitPeriodToControlBetterLocation(int limitPeriodToControlBetterLocation) |
public LocationGpsListener(DeviceLocation deviceLocation)
deviceLocation
- it will be updated by the listenerpublic LocationGpsListener(Device device)
device
- its attribute deviceLocation will be updated by the listenerpublic boolean isGpsEnable()
public int getLimitPeriodToControlBetterLocation()
public void setLimitPeriodToControlBetterLocation(int limitPeriodToControlBetterLocation)
public void enableLocationService(Context context, int timeWait, int minDist)
context
- timeWait
- minimum time interval between location updates, in millisecondsminDist
- minimum distance between location updates, in meterspublic void disableLocationListener()
public void onLocationChanged(Location location)
public static boolean isBetterLocation(Location location, Location currentBestLocation, int limitPeriodInMiliseconds)
location
- The new Location that you want to evaluatecurrentBestLocation
- The current Location fix, to which you want to compare the new onepublic void onProviderDisabled(java.lang.String provider)
public void onProviderEnabled(java.lang.String provider)
public void onStatusChanged(java.lang.String provider, int status, Bundle extras)