detect if user is moving
<p>I would like to detect if a user is moving - either walking or jumping</p>

<p>I have found this code example</p>

<pre><code>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));
</code></pre>

<p>And it gives readings between 0.01 and 0.2 G's - can I use this example for detecting movement??
Perhaps a bit off topic? - sorry if it is!</p>
