|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.palmmedia.android.ShakeDetector
public class ShakeDetector
Detects when the device is shook.
Only one SensorEventListener
can be notified in the current implementation.
Field Summary | |
---|---|
private float |
last_x
The last position. |
private float |
last_y
The last position. |
private float |
last_z
The last position. |
private long |
lastEvent
The time of the last published event. |
private long |
lastUpdate
The time of the last received sensor event. |
private SensorManager |
sensorMgr
The SensorManager. |
private static int |
SHAKE_THRESHOLD
The minimum speed. |
private ShakeEventListener |
shakeEventListener
The ShakeEventListener which is notified when a shake is detected. |
private float |
x
The current position. |
private float |
y
The current position. |
private float |
z
The current position. |
Constructor Summary | |
---|---|
ShakeDetector()
|
Method Summary | |
---|---|
void |
onAccuracyChanged(Sensor arg0,
int arg1)
|
void |
onSensorChanged(SensorEvent sensorEvent)
|
void |
start(Activity activity,
ShakeEventListener shakeEventListener)
Starts the shake detection. |
void |
stop()
Stops the shake detection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ShakeEventListener shakeEventListener
ShakeEventListener
which is notified when a shake is detected.
private SensorManager sensorMgr
private long lastUpdate
private long lastEvent
private float x
private float y
private float z
private float last_x
private float last_y
private float last_z
private static final int SHAKE_THRESHOLD
Constructor Detail |
---|
public ShakeDetector()
Method Detail |
---|
public void start(Activity activity, ShakeEventListener shakeEventListener)
activity
- The activity.shakeEventListener
- The ShakeEventListener
.public void stop()
public void onSensorChanged(SensorEvent sensorEvent)
public void onAccuracyChanged(Sensor arg0, int arg1)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |