How to increase the sampling rate of accelerometer to insanely high rates(2kHz) in android?

StackOverflow https://stackoverflow.com/questions/18509474

سؤال

I am new to android. I am currently working on a project which needs me to measure the acceleration in the range of 1Khz.

From the BMA150 datasheet, I came to know that the maximum Bandwidth supported by it is somewhere near 1Khz.

But android doesn't support this bandwidth meaning it doesn't support very high sampling rate.

Can I increase the sampling rate to the said frequency, if power management is not a much of a concern? Maybe using native methods or something else?

Please help me.

Thanks Vivek

هل كانت مفيدة؟

المحلول

What happens when you use SENSOR_DELAY_FASTEST with registerListener()?

That gets data from the sensor as fast as android can possibly handle, so I imagine that's what you need to do. Because android uses the linux kernel, it's very difficult to create real time code.

If sensor_delay_fastest doesn't work for you, I don't imagine any native code you write will be much faster.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top