Skip to content Skip to sidebar Skip to footer

Android: How To Increase Accelerometer Sampling Rate?

I am currently using Java API to get accelerometer values in 5Hz, which is below my requirements. I want to achieve at least 50Hz. Is there any way to increase the sampling rate of

Solution 1:

I think the maximun sampling rate is diferent between diferent android phones. What i think you can do is setup the sensormanager to update the data as fast as it can, take a look of the constant SENSOR_DELAY_FASTEST from the documentation.

regards.

Solution 2:

The param SENSOR_DELAY_FASTEST indicates to android to poll for data as fast as it can.

The sampling-rate of the accelerometer is determined by the driver is different from the polling rate which is configurable in Android.

There are no APIs for the java/C apps to control the internal sampling-rate. This is because the kernel-drivers do NOT expose any APIs to control the h/w sampling-rate as it is best left to the designers of the device to set this.

You can poll for the accel-data as often as you need it. Check in the source (if you have access) or with the ODM/OEM for details of the accelerometer's internal sampling rate.

Solution 3:

Yse the microphone. If you vibrate the phone in 50 Hz the mic will get it.

Post a Comment for "Android: How To Increase Accelerometer Sampling Rate?"