public class GeoLocationListener
extends java.lang.Object
implements android.location.LocationListener
This class uses for receiving notifications from the LocationManager when the location has changed.
| Constructor and Description |
|---|
GeoLocationListener(android.content.Context context,
SensorResultHandler resultHandler,
int frequency,
boolean enableHighAccuracy,
int maximumAge)
Constructs new listener with the given Context and
SensorResultHandler objects. |
| Modifier and Type | Method and Description |
|---|---|
void |
onLocationChanged(android.location.Location location) |
void |
onProviderDisabled(java.lang.String provider) |
void |
onProviderEnabled(java.lang.String provider) |
void |
onStatusChanged(java.lang.String provider,
int status,
android.os.Bundle extras) |
void |
start()
Unregister the available listener and register new listener for location updates.
|
void |
stop()
Unregister the location updates listener, if any.
|
public GeoLocationListener(android.content.Context context,
SensorResultHandler resultHandler,
int frequency,
boolean enableHighAccuracy,
int maximumAge)
throws java.lang.NullPointerException
SensorResultHandler objects.context - An instance of ContextresultHandler - An instance of SensorResultHandlerfrequency - An interval for getting location updates. This value can be between 50ms and 5000ms.
0 means only once.enableHighAccuracy - true If accurate value is desired. false Otherwise.maximumAge - this value uses for calculating the desired quantity of location updates.
quantity= maximumAge/frequencyjava.lang.NullPointerException - if Context or location manager is null.public void start()
Unregister the available listener and register new listener for location updates.
public void stop()
Unregister the location updates listener, if any.
public void onProviderEnabled(java.lang.String provider)
onProviderEnabled in interface android.location.LocationListenerpublic void onProviderDisabled(java.lang.String provider)
onProviderDisabled in interface android.location.LocationListenerpublic void onStatusChanged(java.lang.String provider,
int status,
android.os.Bundle extras)
onStatusChanged in interface android.location.LocationListenerpublic void onLocationChanged(android.location.Location location)
onLocationChanged in interface android.location.LocationListener