bugshaker-android icon indicating copy to clipboard operation
bugshaker-android copied to clipboard

Activate accelerometer only when it's needed

Open jdauphant opened this issue 8 years ago • 2 comments

Hello,

Apparently the library didn't stop listening the accelerometer. It's start of the seismic lib shakeDetector.start(sensorManager) but never call the stop method. It could be useful to have only the accelerometer activated when it's needed.

jdauphant avatar May 17 '16 16:05 jdauphant

This is worth looking into; there's probably a way to use the activity lifecycle hooks to know when the app is backgrounded (i.e. shake detection can safely be stopped).

stkent avatar May 17 '16 20:05 stkent

Some of the code in https://github.com/stkent/STUtils should be able to take care of this now, with proper adaptation. One thing to think about is whether the Activity reference management can be rolled into the app lifecycle tracking code too.

stkent avatar Jun 25 '16 00:06 stkent