Example usage for Java android.location LocationManager fields, constructors, methods, implement or subclass
The text is from its open source code.
String | NETWORK_PROVIDER Name of the network location provider. |
String | GPS_PROVIDER Name of the GPS location provider. |
String | PASSIVE_PROVIDER A special location provider for receiving locations without actually initiating a location fix. |
String | KEY_PROXIMITY_ENTERING Key used for the Bundle extra holding a boolean indicating whether a proximity alert is entering (true) or exiting (false).. |
String | KEY_PROVIDER_ENABLED Key used for a Bundle extra holding an Boolean status value when a provider enabled/disabled event is broadcast using a PendingIntent. |
String | KEY_LOCATION_CHANGED Key used for a Bundle extra holding a Location value when a location change is broadcast using a PendingIntent. |
String | PROVIDERS_CHANGED_ACTION Broadcast intent action when the configured location providers change. |
String | MODE_CHANGED_ACTION Broadcast intent action when android.provider.Settings.Secure#LOCATION_MODE changes. |
boolean | addGpsStatusListener(GpsStatus.Listener listener) Adds a GPS status listener. |
void | addTestProvider(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. |
void | clearTestProviderEnabled(String provider) Removes any mock enabled value associated with the given provider. |
void | clearTestProviderLocation(String provider) Removes any mock location associated with the given provider. |
void | clearTestProviderStatus(String provider) Removes any mock status values associated with the given provider. |
List | getAllProviders() Returns a list of the names of all known location providers. |
String | getBestProvider(Criteria criteria, boolean enabledOnly) Returns the name of the provider that best meets the given criteria. |
GpsStatus | getGpsStatus(GpsStatus status) Retrieves information about the current status of the GPS engine. |
Location | getLastKnownLocation(String provider) Returns a Location indicating the data from the last known location fix obtained from the given provider. |
Location | getLastLocation() Get the last known location. |
LocationProvider | getProvider(String name) Returns the information associated with the location provider of the given name, or null if no provider exists by that name. |
List | getProviders(boolean enabledOnly) Returns a list of the names of location providers. |
List | getProviders(Criteria criteria, boolean enabledOnly) Returns a list of the names of LocationProviders that satisfy the given criteria, or null if none do. |
boolean | isProviderEnabled(String provider) Returns the current enabled/disabled status of the given provider. |
void | removeGpsStatusListener(GpsStatus.Listener listener) Removes a GPS status listener. |
void | removeProximityAlert(PendingIntent intent) Removes the proximity alert with the given PendingIntent. |
void | removeTestProvider(String provider) Removes the mock location provider with the given name. |
void | removeUpdates(LocationListener listener) Removes all location updates for the specified LocationListener. |
void | removeUpdates(PendingIntent intent) Removes all location updates for the specified pending intent. |
void | requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) Register for location updates using the named provider, and a pending intent. |
void | requestLocationUpdates(String provider, long minTime, float minDistance, PendingIntent intent) Register for location updates using the named provider, and a pending intent. |
void | requestLocationUpdates(long minTime, float minDistance, Criteria criteria, PendingIntent intent) Register for location updates using a Criteria and pending intent. |
void | requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper, PendingIntent intent) |
void | requestLocationUpdates(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. |
void | requestLocationUpdates(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. |
void | requestSingleUpdate(String provider, LocationListener listener, Looper looper) Register for a single location update using the named provider and a callback. |
void | requestSingleUpdate(Criteria criteria, LocationListener listener, Looper looper) Register for a single location update using a Criteria and a callback. |
boolean | sendExtraCommand(String provider, String command, Bundle extras) Sends additional commands to a location provider. |
void | setTestProviderEnabled(String provider, boolean enabled) Sets a mock enabled value for the given provider. |
void | setTestProviderLocation(String provider, Location loc) Sets a mock location for the given provider. |
void | setTestProviderStatus(String provider, int status, Bundle extras, long updateTime) Sets mock status values for the given provider. |