The members of Android.Hardware.SensorEvent are listed below.
See Also: Inherited members from Java.Lang.Object
| A constructor used when creating managed representations of JNI objects; called by the runtime. |
| Accuracy | SensorStatus. The accuracy of this event. | |
| Sensor | Sensor. The sensor that generated this event. | |
| Timestamp | long. The time in nanosecond at which the event happened | |
| Values | IList<float>. Sensor.TYPE_ACCELEROMETER:All values are in SI units (m/s^2)
java Example
public void onSensorChanged(SensorEvent event)
{
// alpha is calculated as t / (t + dT)
// with t, the low-pass filter's time-constant
// and dT, the event delivery rate
final float alpha = 0.8;
gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];
gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];
gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];
linear_acceleration[0] = event.values[0] - gravity[0];
linear_acceleration[1] = event.values[1] - gravity[1];
linear_acceleration[2] = event.values[2] - gravity[2];
}
|
| [read-only] override | ThresholdClass | IntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
| [read-only] override | ThresholdType | Type. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |