javax.microedition.location
Interface LocationProvider


public interface LocationProvider

A LocationProvider represents a location-providing module, generating Locations. Applications obtain LocationProvider instances by calling the factory method in the LocationManager. It is the responsibility of the implementation to return the correct LocationProvider-derived object. Applications that need to specify criteria for the location provider selection, must first create a Criteria object, and pass it to the factory method. The methods that access the location related information shall throw SecurityException if the application does not have the relevant permission to access the location information.

Author:
donsez

Field Summary
static int AVAILABLE
          Availability status code: the location provider is available.
static int PERMANENTLY_UNAVAILABLE
          Availability status code: the location provider is permanently unavailable.
static int TEMPORARILY_UNAVAILABLE
          Availability status code: the location provider is temporarily unavailable.
 
Method Summary
 void addLocationListener(LocationListener listener, int interval)
          Adds a LocationListener for updates at the defined interval.
 Location getLatestKnownLocation()
          Returns the latest known location that the implementation has.
 Location getLocation(int timeout)
          Retrieves a Location with the constraints given by the Criteria associated with this class.
 int getState()
          Returns the current state of this LocationProvider.
 void removeLocationListener(LocationListener listener)
          Removes a LocationListener
 void reset()
          Resets the LocationProvider.
 

Field Detail

AVAILABLE

public static final int AVAILABLE
Availability status code: the location provider is available.

See Also:
Constant Field Values

PERMANENTLY_UNAVAILABLE

public static final int PERMANENTLY_UNAVAILABLE
Availability status code: the location provider is permanently unavailable.

See Also:
Constant Field Values

TEMPORARILY_UNAVAILABLE

public static final int TEMPORARILY_UNAVAILABLE
Availability status code: the location provider is temporarily unavailable.

See Also:
Constant Field Values
Method Detail

getLatestKnownLocation

public Location getLatestKnownLocation()
Returns the latest known location that the implementation has.

Returns:
The latestKnownLocation value

getLocation

public Location getLocation(int timeout)
Retrieves a Location with the constraints given by the Criteria associated with this class.

Parameters:
timeout - Description of the Parameter
Returns:
The location value

getState

public int getState()
Returns the current state of this LocationProvider.

Returns:
The state value

reset

public void reset()
Resets the LocationProvider.


addLocationListener

public void addLocationListener(LocationListener listener,
                                int interval)
Adds a LocationListener for updates at the defined interval.

Parameters:
listener - The new locationListener value
interval - The new interval value

removeLocationListener

public void removeLocationListener(LocationListener listener)
Removes a LocationListener

Parameters:
listener - the listener to remove