public class AndroidOrientation
extends java.lang.Object
implements android.hardware.SensorEventListener
Constructor and Description |
---|
AndroidOrientation() |
Modifier and Type | Method and Description |
---|---|
double |
getAngle()
Returns the angle in which the orientation sensor is tilted, treating Roll as the x-coordinate
and Pitch as the y-coordinate.
|
AngleUnit |
getAngleUnit()
Returns the AngleUnit being used.
|
double |
getAzimuth()
Returns the azimuth.
|
double |
getMagnitude()
Returns a number between 0 and 1, indicating how much the device is tilted.
|
double |
getPitch()
Returns the pitch.
|
double |
getRoll()
Returns the roll.
|
boolean |
isAvailable()
Returns true if the Android device has the sensors required for orientation.
|
void |
onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy) |
void |
onSensorChanged(android.hardware.SensorEvent sensorEvent) |
void |
setAngleUnit(AngleUnit angleUnit)
Sets the AngleUnit to be used.
|
void |
startListening()
Start listening to events from the Android sensors.
|
void |
stopListening()
Stop listening to events from the Android sensors.
|
public void onAccuracyChanged(android.hardware.Sensor sensor, int accuracy)
onAccuracyChanged
in interface android.hardware.SensorEventListener
public void onSensorChanged(android.hardware.SensorEvent sensorEvent)
onSensorChanged
in interface android.hardware.SensorEventListener
public void setAngleUnit(AngleUnit angleUnit)
public AngleUnit getAngleUnit()
public double getAzimuth()
public double getPitch()
public double getRoll()
public double getAngle()
public double getMagnitude()
public boolean isAvailable()
public void startListening()
public void stopListening()