FileDocCategorySizeDatePackage
LocationProvider.javaAPI DocphoneME MR2 API (J2ME)3976Wed May 02 18:00:40 BST 2007javax.microedition.location

LocationProvider

public abstract class LocationProvider extends Object
This class is defined by the JSR-179 specification Location API for J2ME for J2ME™.

Fields Summary
private static final String
PROXIMITY_SUPPORTED
Proximity support property
public static final int
AVAILABLE
public static final int
TEMPORARILY_UNAVAILABLE
public static final int
OUT_OF_SERVICE
Constructors Summary
protected LocationProvider()


    // JAVADOC COMMENT ELIDED
      
    
Methods Summary
public static voidaddProximityListener(ProximityListener listener, Coordinates coordinates, float proximityRadius)

        String proximitySupported = 
                Configuration.getProperty(PROXIMITY_SUPPORTED);
        if (proximitySupported.equals("true")) {
            Util.checkForPermission(Permissions.LOCATION_PROXIMITY, false);
            if (listener == null || coordinates == null) {
                throw new NullPointerException();
            }
            if (proximityRadius <= 0.0F || Float.isNaN(proximityRadius)) {
                throw new IllegalArgumentException(
                    "Illegal proximityRadius: " + proximityRadius);
            }
            ProximityNotifier.getInstance().addProximityListener(listener,
                coordinates, proximityRadius);
        } else {
            throw new LocationException(
                    "Proximity monitoring is not supported");
        }
    
public static javax.microedition.location.LocationProvidergetInstance(Criteria criteria)

        return LocationProviderImpl.getInstanceImpl(criteria);
    
public static LocationgetLastKnownLocation()

        Util.checkForPermission(Permissions.LOCATION, false);
        return LocationProviderImpl.getLastKnownLocation();
    
public abstract LocationgetLocation(int timeout)

public abstract intgetState()

public static voidremoveProximityListener(ProximityListener listener)

        if (listener == null) {
	    throw new NullPointerException("Proximity listener is null");
	}
        ProximityNotifier.getInstance().removeProximityListener(listener);
    
public abstract voidreset()

public abstract voidsetLocationListener(LocationListener listener, int interval, int timeout, int maxAge)