Android: reading accelerometer without memory allocation?

前端 未结 2 819
有刺的猬
有刺的猬 2021-02-09 14:12

I am developing a game for Android (2.1+), using the accelerometer as user input. I use a sensor listener that I register at the beginning of the activity with the sensor manage

相关标签:
2条回答
  • 2021-02-09 14:44

    Sounds like something we need to fix on our side, I'll file a bug internally.

    0 讨论(0)
  • 2021-02-09 15:08

    I believe this problem only occurs when there is more than one Sensor registered to a SensorEventListener. I think a workaround would be to use a different SensorEventListener per Sensor.

    Also make sure to NOT register the SAME Sensor with two different SensorEventListener -- there was a bug in that case that got fixed in Gingerbread.

    Another, less attractive, option would be to use the Gingerbread NDK, which doesn't have this issue.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题