Skip to content Skip to sidebar Skip to footer

Android: Reading Accelerometer Without Memory Allocation?

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 manager,

Solution 1:

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

Solution 2:

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.

Post a Comment for "Android: Reading Accelerometer Without Memory Allocation?"