开发者

Get Acceleration only in one direction using ACCELEROMETER

开发者 https://www.devze.com 2023-02-14 18:19 出处:网络
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.

0

精彩评论

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