Java android.location LocationManager fields, constructors, methods, implement or subclass

Example usage for Java android.location LocationManager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.location LocationManager.

The text is from its open source code.

Field

StringNETWORK_PROVIDER
Name of the network location provider.
StringGPS_PROVIDER
Name of the GPS location provider.
StringPASSIVE_PROVIDER
A special location provider for receiving locations without actually initiating a location fix.
StringKEY_PROXIMITY_ENTERING
Key used for the Bundle extra holding a boolean indicating whether a proximity alert is entering (true) or exiting (false)..
StringKEY_PROVIDER_ENABLED
Key used for a Bundle extra holding an Boolean status value when a provider enabled/disabled event is broadcast using a PendingIntent.
StringKEY_LOCATION_CHANGED
Key used for a Bundle extra holding a Location value when a location change is broadcast using a PendingIntent.
StringPROVIDERS_CHANGED_ACTION
Broadcast intent action when the configured location providers change.
StringMODE_CHANGED_ACTION
Broadcast intent action when android.provider.Settings.Secure#LOCATION_MODE changes.

Method

booleanaddGpsStatusListener(GpsStatus.Listener listener)
Adds a GPS status listener.
voidaddTestProvider(String name, boolean requiresNetwork, boolean requiresSatellite, boolean requiresCell, boolean hasMonetaryCost, boolean supportsAltitude, boolean supportsSpeed, boolean supportsBearing, int powerRequirement, int accuracy)
Creates a mock location provider and adds it to the set of active providers.
voidclearTestProviderEnabled(String provider)
Removes any mock enabled value associated with the given provider.
voidclearTestProviderLocation(String provider)
Removes any mock location associated with the given provider.
voidclearTestProviderStatus(String provider)
Removes any mock status values associated with the given provider.
ListgetAllProviders()
Returns a list of the names of all known location providers.
StringgetBestProvider(Criteria criteria, boolean enabledOnly)
Returns the name of the provider that best meets the given criteria.
GpsStatusgetGpsStatus(GpsStatus status)
Retrieves information about the current status of the GPS engine.
LocationgetLastKnownLocation(String provider)
Returns a Location indicating the data from the last known location fix obtained from the given provider.
LocationgetLastLocation()
Get the last known location.
LocationProvidergetProvider(String name)
Returns the information associated with the location provider of the given name, or null if no provider exists by that name.
ListgetProviders(boolean enabledOnly)
Returns a list of the names of location providers.
ListgetProviders(Criteria criteria, boolean enabledOnly)
Returns a list of the names of LocationProviders that satisfy the given criteria, or null if none do.
booleanisProviderEnabled(String provider)
Returns the current enabled/disabled status of the given provider.
voidremoveGpsStatusListener(GpsStatus.Listener listener)
Removes a GPS status listener.
voidremoveProximityAlert(PendingIntent intent)
Removes the proximity alert with the given PendingIntent.
voidremoveTestProvider(String provider)
Removes the mock location provider with the given name.
voidremoveUpdates(LocationListener listener)
Removes all location updates for the specified LocationListener.
voidremoveUpdates(PendingIntent intent)
Removes all location updates for the specified pending intent.
voidrequestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)
Register for location updates using the named provider, and a pending intent.
voidrequestLocationUpdates(String provider, long minTime, float minDistance, PendingIntent intent)
Register for location updates using the named provider, and a pending intent.
voidrequestLocationUpdates(long minTime, float minDistance, Criteria criteria, PendingIntent intent)
Register for location updates using a Criteria and pending intent.
voidrequestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper, PendingIntent intent)
voidrequestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper)
Register for location updates using the named provider, and a callback on the specified looper thread.
voidrequestLocationUpdates(long minTime, float minDistance, Criteria criteria, LocationListener listener, Looper looper)
Register for location updates using a Criteria, and a callback on the specified looper thread.
voidrequestSingleUpdate(String provider, LocationListener listener, Looper looper)
Register for a single location update using the named provider and a callback.
voidrequestSingleUpdate(Criteria criteria, LocationListener listener, Looper looper)
Register for a single location update using a Criteria and a callback.
booleansendExtraCommand(String provider, String command, Bundle extras)
Sends additional commands to a location provider.
voidsetTestProviderEnabled(String provider, boolean enabled)
Sets a mock enabled value for the given provider.
voidsetTestProviderLocation(String provider, Location loc)
Sets a mock location for the given provider.
voidsetTestProviderStatus(String provider, int status, Bundle extras, long updateTime)
Sets mock status values for the given provider.