The android accelerometer is of the sensor. type_accelerometer type.
Return the value of the accelerometer through Android. Hardware. sensorevent.
The Unit returned by the accelerometer is the unit of acceleration m/s ^ 2 (meter per second). The values in three directions are
Values [0]: X-axis Acceleration
Values [1]: acceleration in Y-axis direction
Values [2]: acceleration in the z-axis direction
The X, Y, and Z directions are defined as the coordinates of the reference system (such as) on the Right and bottom of the horizontally placed mobile phone)
The Direction X is the horizontal direction of the mobile phone, and the right is positive
The Y direction is the horizontal vertical direction of the mobile phone, and the front is positive
The Y direction is the vertical direction of the mobile phone space, the direction of the sky is positive, and the direction of the earth is negative
X <0 x> 0
^
|
+ ----------- + --> Y> 0
|
|
|
|/Z <0
|/
|/
O ----------- +/
| [] [] []/
+ ----------/+ Y <0
/
/
|/Z> 0 (toward the sky)
O: origin (x = 0, y = 0, Z = 0)
Note that due to the inherent gravity acceleration G of the Earth (the value is 9.8 Mb/s ^ 2 ),
Therefore, in reality, the actual acceleration value should be the Z-direction return value-9.8 m/s ^ 2.
For example, if you throw a mobile phone at the acceleration of 2 Mb/s ^ 2, then the return value in the z direction is 11.8 Mb/s ^ 2.
Otherwise, if the mobile phone drops at a 2 Mbit/s ^ 2 acceleration, the return value in the z direction should be 7.8 Mbit/s ^ 2.
In the X and Y directions, there is no such restriction.