I am using SensorEventListener for开发者_运维百科 geting gravity..
But I want Gravity only x-direction..
I am using SensorEventListener for
开发者_运维百科 geting gravity..
But I want Gravity only x-direction..
What I do for geting acceleration value only in X-direction..
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.
精彩评论