|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.location.LocationProvider
org.placelab.jsr0179.LocationProviderImpl
| Field Summary | |
protected static int |
DEFAULT_INTERVAL
Default polling interval used for LocationListener's |
protected static int |
DEFAULT_MAXAGE
The max age an estimate can be before it is considered stale |
protected static int |
DEFAULT_TIMEOUT
Default timeout when getting a location, in seconds. |
| Fields inherited from class javax.microedition.location.LocationProvider |
AVAILABLE, OUT_OF_SERVICE, TEMPORARILY_UNAVAILABLE |
| Constructor Summary | |
LocationProviderImpl()
|
|
| Method Summary | |
void |
addProximityListenerImpl(javax.microedition.location.ProximityListener listener,
javax.microedition.location.Coordinates coordinates,
float proximityRadius)
|
void |
estimateUpdated(Tracker t,
Estimate e,
Measurement m)
Implement this method to respond to updates from the Tracker(s) you are registered with. |
javax.microedition.location.Location |
getLastKnownLocationImpl()
|
javax.microedition.location.Location |
getLocation(int timeout)
Performs a synchronous request for location. |
int |
getState()
Returns the current state of this LocationProvider. |
void |
removeProximityListenerImpl(javax.microedition.location.ProximityListener listener)
|
void |
reset()
Resets the LocationProvider. |
void |
setLocationListener(javax.microedition.location.LocationListener listener,
int interval,
int timeout,
int maxAge)
Adds a LocationListener for updates at the defined interval. |
| Methods inherited from class javax.microedition.location.LocationProvider |
addProximityListener, getInstance, getLastKnownLocation, removeProximityListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int DEFAULT_TIMEOUT
protected static final int DEFAULT_INTERVAL
protected static final int DEFAULT_MAXAGE
| Constructor Detail |
public LocationProviderImpl()
throws javax.microedition.location.LocationException
| Method Detail |
public int getState()
javax.microedition.location.LocationProvider
public javax.microedition.location.Location getLocation(int timeout)
throws javax.microedition.location.LocationException,
java.lang.InterruptedException
timeout - a timeout value in seconds. -1 is used to indicate that the
implementation shall use its default timeout value for this
provider.
java.lang.InterruptedException - if the operation is interrupted by calling reset() from
another thread
javax.microedition.location.LocationException - if the location couldn't be retrieved or if the timeout
period expiredpublic javax.microedition.location.Location getLastKnownLocationImpl()
public void setLocationListener(javax.microedition.location.LocationListener listener,
int interval,
int timeout,
int maxAge)
javax.microedition.location.LocationProvider
listener - the listener to be registered. If set to null the registration
of any previously set listener is cancelled.interval - the interval in seconds. -1 is used for the default interval
of this provider. 0 is used to indicate that the application
wants to receive only provider status updates and not location
updates at all.timeout - timeout value in seconds, must be greater than 0. if the value
is -1, the default timeout for this provider is used. Also, if
the interval is -1 to indicate the default, the value of this
parameter has no effect and the default timeout for this
provider is used. If the interval is 0, this parameter has no
effect.maxAge - maximum age of the returned location in seconds, must be
greater than 0 or equal to -1 to indicate that the default
maximum age for this provider is used. Also, if the interval
is -1 to indicate the default, the value of this parameter has
no effect and the default maximum age for this provider is
used. If the interval is 0, this parameter has no effect.public void reset()
javax.microedition.location.LocationProvider
public void addProximityListenerImpl(javax.microedition.location.ProximityListener listener,
javax.microedition.location.Coordinates coordinates,
float proximityRadius)
throws javax.microedition.location.LocationException
javax.microedition.location.LocationExceptionpublic void removeProximityListenerImpl(javax.microedition.location.ProximityListener listener)
public void estimateUpdated(Tracker t,
Estimate e,
Measurement m)
EstimateListener
estimateUpdated in interface EstimateListenert - the Tracker producing the Estimatee - the Estimate produced by the Trackerm - the latest Measurement used by the Tracker to produce the Estimate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||