如何使用Android的加速计检测 [英] How To use Android Accelerometer Detection

查看:85
本文介绍了如何使用Android的加速计检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何计算加速度计movement.When我把水平处于闲置状态,同样的手机时,我将移动的手中,因此,有加速计值的变化时,它是水平放置或当它在手垂直。如何识别它们,任何样品codeS将是有益的。

i want to know how to calculate the accelerometer movement.When i place the mobile horizontally in idle state and similarly when i place the mobile in hands,So there accelerometer value change when it is place horizontally or while it is in hand vertically.How To Identify them,Any Sample Codes will be useful

推荐答案

你为什么不使用这个例子:

Why don't you use this example:

<一个href="http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it#comment9376244_2318356">Android:我想动摇它

您可以检查每一个步骤和其他之间的时间差 - 这将帮助您模拟步

You can then check time difference between every step and other - this will help you simulate a step.

这篇关于如何使用Android的加速计检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆