安卓加速度计 : Sampling Rate?

标签 android accelerometer android-sensors sampling rate

我要

[1] 提高手机加速度计的采样率。 (SENSOR_DELAY_FASTEST 在 Xperia 上给出最大大约 100Hz/在 Nexus4 上为 180Hz, 对于我的工作,我希望延迟大约为 1 毫秒或更短。

[2] 如果 [1] 不可能我可以让 Rate 保持不变吗

mSensorManager.registerListener(this, mAccelerometer,10000);//10000 in microsec

上面的代码不会给我 10 毫秒的延迟。我知道这只是对 Android 的建议。

我知道手机中的这些加速度计能够提供更小的延迟。他们的数据表中提到了这一点。他们的任何方法或驱动程序/ADC 编程也是如此 [1] 或 [2]。 我正在使用 ADT 工具。还有其他工具可以做到这一点吗?

P.S: 我读过

Android: How to increase Accelerometer Sampling Rate?

Impossibility to change the rate of the accelerometer

最佳答案

来自 developer.android.com :

The data delay (or sampling rate) controls the interval at which sensor events are sent to your application via the onSensorChanged() callback method. The default data delay is suitable for monitoring typical screen orientation changes and uses a delay of 200,000 microseconds. You can specify other data delays, such as SENSOR_DELAY_GAME (20,000 microsecond delay), SENSOR_DELAY_UI (60,000 microsecond delay), or SENSOR_DELAY_FASTEST (0 microsecond delay). As of Android 3.0 (API Level 11) you can also specify the delay as an absolute value (in microseconds).

但是您应该知道,您以微秒为单位指定的绝对值只是对 Android 的建议

关于安卓加速度计 : Sampling Rate?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17663191/

相关文章:

iphone - 如何在 iPhone 中使用 userAcceleration

java - 修改 switch 语句内的变量以便在 switch 外部使用

java - 后退按钮将我踢出 WebView 上的应用程序

java - 我在 dalvik.system.PathClassLoader.findClass 中的启动器主题 java.lang.ClassNotFoundException 上不断收到此错误

android - 如何获取android中所有应用程序在给定时间段(例如,上个月)内使用的移动数据总量的统计信息

ios - 使用CMDeviceMotion获取绝对旋转?

java - 如何将 listView 包含在布局中,而布局中已经有其他 View

android - 实现计步器 : How to find a local peak?

android - 等效替换已弃用的 Sensor.TYPE_ORIENTATION

java - 收集特定时间段的android传感器并计算平均值