Get Acceleration only in one direction using ACCELEROMETER
To be more specific from the answer from Rajnikant, look here : http://developer.android.com/reference/android/hardware/SensorEvent.html#values
values[0] gives you the acceleration on the X-axis...
Refer this under Sensor.TYPE_ACCELEROMETER section.
精彩评论