编写了一个打印加速度计输出的简单程序。
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
事实证明:
加速度计输出始终设置为“最低”,具体取决于:
public void onAccuracyChanged(Sensor sensor, int accuracy) { if (collectingData){ accelPrecision.setText("accelerometer accuracy: " + accuracy); } }
实际的加速度计读数非常不准确——即使它放在桌子上也有大约 2%-5% 的波动
据我所知,Nexus S、Nexus One 和 G1 也存在同样的问题
知道如何使模式准确/什么设置