Skip to content Skip to sidebar Skip to footer

Detecting Movement Using Accelerometer - (orientation Is Not Changing)?

I understand that we can detect orientation and its changes using accelerometer. Like whether the mobile phone is placed upside down, sideways or whatever. Can we detect movement o

Solution 1:

Yes. Look at LINEAR_ACCELERATION for example. Even if the orientation is not changing you will see changes in the acceleration.

Just don't try to integrate it to get velocity or position because it is not accurate enough for that.


Look at the change in length of TYPE_ACCELEROMETER (i.e. sqrt(x^2+y^2+z^2)). Define a threshold and if the change exceeds the threshold then the device has been moved.

Post a Comment for "Detecting Movement Using Accelerometer - (orientation Is Not Changing)?"