Need to read android sensors really fast

前端 未结 5 1381
臣服心动
臣服心动 2021-02-05 07:55

Issue:-

  1. I am developing a application which needs a new acceleration datum every 5 millisecond.

My Approach:-

5条回答
  •  梦毁少年i
    2021-02-05 08:12

    Regarding the speed of the Android SensorManager, I would be more inclined to suspect the speed of the Android file I/O that is generating your log. You might try a benchmark of your sensor read code without writing to the log. Something like logging the current time in milliseconds, then doing 1,000,000 sensor reads, then logging the current time again. You might still have to use the C version to get the data, but at least you'll know definitively where the bottleneck lies.

提交回复
热议问题