public class GpsMyLocationProvider extends Object implements IMyLocationProvider, android.location.LocationListener
Constructor and Description |
---|
GpsMyLocationProvider(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
android.location.Location |
getLastKnownLocation() |
float |
getLocationUpdateMinDistance() |
long |
getLocationUpdateMinTime() |
void |
onLocationChanged(android.location.Location location) |
void |
onProviderDisabled(String provider) |
void |
onProviderEnabled(String provider) |
void |
onStatusChanged(String provider,
int status,
android.os.Bundle extras) |
void |
setLocationUpdateMinDistance(float meters)
Set the minimum distance for location updates.
|
void |
setLocationUpdateMinTime(long milliSeconds)
Set the minimum interval for location updates.
|
boolean |
startLocationProvider(IMyLocationConsumer myLocationConsumer)
Enable location updates and show your current location on the map.
|
void |
stopLocationProvider() |
public GpsMyLocationProvider(android.content.Context context)
public long getLocationUpdateMinTime()
public void setLocationUpdateMinTime(long milliSeconds)
LocationManager.requestLocationUpdates(String, long, float, LocationListener)
. Note
that you should call this before calling MyLocationNewOverlay.enableMyLocation()
.milliSeconds
- public float getLocationUpdateMinDistance()
public void setLocationUpdateMinDistance(float meters)
LocationManager.requestLocationUpdates(String, long, float, LocationListener)
. Note
that you should call this before calling MyLocationNewOverlay.enableMyLocation()
.meters
- public boolean startLocationProvider(IMyLocationConsumer myLocationConsumer)
setLocationUpdateMinTime(long)
and/or setLocationUpdateMinDistance(float)
before calling this method.startLocationProvider
in interface IMyLocationProvider
public void stopLocationProvider()
stopLocationProvider
in interface IMyLocationProvider
public android.location.Location getLastKnownLocation()
getLastKnownLocation
in interface IMyLocationProvider
public void onLocationChanged(android.location.Location location)
onLocationChanged
in interface android.location.LocationListener
public void onProviderDisabled(String provider)
onProviderDisabled
in interface android.location.LocationListener
public void onProviderEnabled(String provider)
onProviderEnabled
in interface android.location.LocationListener
public void onStatusChanged(String provider, int status, android.os.Bundle extras)
onStatusChanged
in interface android.location.LocationListener
Copyright © 2015. All Rights Reserved.