public class AndroidGyroscope
extends java.lang.Object
implements android.hardware.SensorEventListener
Constructor and Description |
---|
AndroidGyroscope() |
Modifier and Type | Method and Description |
---|---|
AngleUnit |
getAngleUnit()
Returns the AngleUnit being used.
|
AngularVelocity |
getAngularVelocity()
Returns an AngularVelocity object representing the rate of rotation around the device's local
X, Y and Z axis.
|
float |
getX()
Returns the angular speed around the x-axis.
|
float |
getY()
Returns the angular speed around the y-axis.
|
float |
getZ()
Returns the angular speed around the z-axis.
|
boolean |
isAvailable()
Returns true if the Android device has a gyroscope.
|
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 gyroscope.
|
void |
stopListening()
Stop listening to events from the Android gyroscope.
|
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 float getX()
public float getY()
public float getZ()
public AngularVelocity getAngularVelocity()
public boolean isAvailable()
public void startListening()
public void stopListening()