开发者

Detecting the device moving direction using ACCELEROMETER in Android

Using the SensorManager I can find the x,y,z from the ACCELEROMETER. I can detect that the device moves, but how I can I check开发者_StackOverflow社区 if it moves DOWN direction and not up?

thanks.


The value will be negative.

Edit: The value of y will be negative if its moving down. Positive if its moving up (I accept it may actually be the other way round and negative for up positive for down I've not played with the android accelerometer yet so I'm going on other accelerometers i have used).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜