public class MotionDetection
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MotionDetection.MotionDetectionListener |
class |
MotionDetection.Vector |
Modifier and Type | Field and Description |
---|---|
protected MotionDetection.Vector |
gravity |
Constructor and Description |
---|
MotionDetection() |
MotionDetection(double detectionThreshold,
int rateLimitSeconds) |
Modifier and Type | Method and Description |
---|---|
protected MotionDetection.Vector |
filter(SensorEvent sensorEvent)
filter
Taken straight from the google documentation for implementing a low pass
filter for filtering out gravity.
|
boolean |
isAvailable()
Is the required sensor available on this device?
|
protected void |
notifyListeners(double vector) |
void |
onAccuracyChanged(Sensor sensor,
int i) |
void |
onSensorChanged(SensorEvent sensorEvent)
Internal implementations of the SensorEventListener interface.
|
void |
purgeListeners()
purgeListeners
|
void |
registerListener(MotionDetection.MotionDetectionListener listener)
registerListener
|
void |
startListening()
Start processing sensor data.
|
void |
stopListening()
Stop processing sensor data.
|
protected MotionDetection.Vector gravity
public MotionDetection()
public MotionDetection(double detectionThreshold, int rateLimitSeconds)
protected MotionDetection.Vector filter(SensorEvent sensorEvent)
sensorEvent
- The sensor data spit out by android for the accelerometer.public void registerListener(MotionDetection.MotionDetectionListener listener)
public void purgeListeners()
public boolean isAvailable()
public void startListening()
public void stopListening()
protected void notifyListeners(double vector)
public void onSensorChanged(SensorEvent sensorEvent)
public void onAccuracyChanged(Sensor sensor, int i)