|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.location.LocationProvider
android.location.LocationProviderImpl
public abstract class LocationProviderImpl
An abstract superclass for location provider implementations. Location provider implementations are typically instantiated by the location manager service in the system process, and location information is made available to implementations via the manager.
| Field Summary |
|---|
| Fields inherited from class android.location.LocationProvider |
|---|
AVAILABLE, BAD_CHARS_REGEX, OUT_OF_SERVICE, TEMPORARILY_UNAVAILABLE |
| Constructor Summary | |
|---|---|
protected |
LocationProviderImpl(String name)
|
| Method Summary | |
|---|---|
static void |
addProvider(LocationProviderImpl provider)
|
abstract void |
disable()
Disables this provider. |
abstract void |
enable()
Enables this provider. |
void |
enableLocationTracking(boolean enable)
Notifies the location provider that clients are listening for locations. |
abstract boolean |
getLocation(Location l)
Sets a Location object with the information gathered during the most recent fix. |
long |
getMinTime()
Gets the smallest minimum time between updates amongst all the clients listening for locations. |
static LocationProviderImpl |
getProvider(String name)
|
static List<LocationProviderImpl> |
getProviders()
|
int |
getStatus()
Returns a information on the status of this provider. |
abstract int |
getStatus(Bundle extras)
Returns a information on the status of this provider. |
long |
getStatusUpdateTime()
Returns the time at which the status was last updated. |
abstract boolean |
isEnabled()
Returns true if this provider is enabled, false otherwise; |
boolean |
isLocationTracking()
Returns true if the provider has any listeners |
static LocationProviderImpl |
loadFromClass(File classFile)
|
static void |
removeProvider(LocationProviderImpl provider)
|
boolean |
sendExtraCommand(String command,
Bundle extras)
Implements addditional location provider specific additional commands. |
void |
setMinTime(long minTime)
Notifies the location provider of the smallest minimum time between updates amongst all clients that are listening for locations. |
void |
updateCellState(com.android.internal.location.CellState state)
Updates the cell state for the given provider. |
void |
updateNetworkState(int state)
Updates the network state for the given provider. |
| Methods inherited from class android.location.LocationProvider |
|---|
getAccuracy, getName, getPowerRequirement, hasMonetaryCost, meetsCriteria, requiresCell, requiresNetwork, requiresSatellite, supportsAltitude, supportsBearing, supportsSpeed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LocationProviderImpl(String name)
| Method Detail |
|---|
public static void addProvider(LocationProviderImpl provider)
public static void removeProvider(LocationProviderImpl provider)
public static List<LocationProviderImpl> getProviders()
public static LocationProviderImpl getProvider(String name)
public static LocationProviderImpl loadFromClass(File classFile)
public abstract void enable()
getStatus()
and getLocation(android.location.Location) must be handled. Hardware may be started up
when the provider is enabled.
public abstract void disable()
getStatus()
and getLocation(android.location.Location) need not be handled. Hardware may be shut
down while the provider is disabled.
public abstract boolean isEnabled()
public int getStatus()
LocationProvider.OUT_OF_SERVICE is returned if the provider is
out of service, and this is not expected to change in the near
future; LocationProvider.TEMPORARILY_UNAVAILABLE is returned if
the provider is temporarily unavailable but is expected to be
available shortly; and LocationProvider.AVAILABLE is returned
if the provider is currently available.
public abstract int getStatus(Bundle extras)
LocationProvider.OUT_OF_SERVICE is returned if the provider is
out of service, and this is not expected to change in the near
future; LocationProvider.TEMPORARILY_UNAVAILABLE is returned if
the provider is temporarily unavailable but is expected to be
available shortly; and LocationProvider.AVAILABLE is returned
if the provider is currently available.
If extras is non-null, additional status information may be added to it in the form of provider-specific key/value pairs.
public long getStatusUpdateTime()
android.os.SystemClock.elapsedRealtime() each time
there is a status update that it wishes to broadcast to all its
listeners. The provider should be careful not to broadcast
the same status again.
public abstract boolean getLocation(Location l)
l - location object to set
public void enableLocationTracking(boolean enable)
enable - true if location tracking should be enabled.public boolean isLocationTracking()
public void setMinTime(long minTime)
minTime - the smallest minTime value over all listeners for this provider.public long getMinTime()
public void updateNetworkState(int state)
LocationProvider.requiresNetwork() returns true. The state is
LocationProvider.TEMPORARILY_UNAVAILABLE (disconnected), OR LocationProvider.AVAILABLE
(connected or connecting).
state - data statepublic void updateCellState(com.android.internal.location.CellState state)
LocationProvider.requiresCell() returns true.
state - cell state
public boolean sendExtraCommand(String command,
Bundle extras)
command - name of the command to send to the provider.extras - optional arguments for the command (or null).
The provider may optionally fill the extras Bundle with results from the command.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||