I'm working on adding a calibration feature to an accelerometer-driven game. For the calibration, I need a single value from the accelerometer. Should I register a listener, get the first value it gives me, and unregister it, or is there a better way to get just one value?
Basically there is no way to do get a single value as far as I can tell. What I ended up doing is putting in a variable called lastAccelValue and registering my Activity to listen for accelerometer updates at the slowest possible speed. Each new accelerometer value is stored to lastAccelValue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With