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

Orientation

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

Fields Summary
private static final String
ORIENTATION_SUPPORTED
Orientation support property
private float
azimuth
Angle off the horizon.
private boolean
isMagnetic
Sample uses magnetic north.
private float
pitch
Pitch direction.
private float
roll
Roll direction.
Constructors Summary
public Orientation(float azimuth, boolean isMagnetic, float pitch, float roll)


    // JAVADOC COMMENT ELIDED
        
		           
        this.azimuth = azimuth;
        this.isMagnetic = isMagnetic;
        this.pitch = pitch;
        this.roll = roll;
    
Methods Summary
public floatgetCompassAzimuth()

        return azimuth;
    
public static javax.microedition.location.OrientationgetOrientation()

        String orientationSupported = 
                Configuration.getProperty(ORIENTATION_SUPPORTED);
        if (orientationSupported.equals("true")) {
            Util.checkForPermission(Permissions.ORIENTATION);
            OrientationProvider provider = OrientationProvider.getInstance();
            if (provider != null) {
                return provider.getOrientation();
            }
        } else {
            throw new LocationException("Orientation retrieval not supported");
        }
        return null;
    
public floatgetPitch()

        return pitch;
    
public floatgetRoll()

        return roll;
    
public booleanisOrientationMagnetic()

        return isMagnetic;