# detect movement - how does it relate to G force

I would like to detect if a user is moving by using an android smartphone - walking or jumping doesn't matter - want to know if the user wearing the smartphone is moving.

I have found this code example

private final SensorEventListener sensorEventListener = new SensorEventListener() {
double calibration = SensorManager.STANDARD_GRAVITY;

public void onAccuracyChanged(Sensor sensor, int accuracy) {
}

public void onSensorChanged(SensorEvent event) {
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];

double a = Math.round(Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)
+ Math.pow(z, 2)));
currentAcceleration = Math.abs((float) (a - calibration));


basically the squarerootof the three axis, which are raised to power 2 = sqrt(x-axis^2 + y-axis^2 + z-axis^2) = G force

And it gives readings between 0.01 and 0.2 G's - does anyone know how to translate these readings into "movement" - is it even possible this way - by use of G force

-
Do you understand the basics of the types of motion that you want to detect? How long do you expect them to last (timescale)? How abrupt do you expect them to be (scale of the acceleration itself)? I mean, at this point it looks like you are able to measure the RMS acceleration...so why don't you just collect some data on the kinds of motion that you are interested in. – dmckee Sep 10 '12 at 23:00

$$a = \frac{dv}{dt}$$