开发者

Get Acceleration only in one direction using ACCELEROMETER

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜