This is an easy to use shake detector library on android devices
usage is literally 4 lines of code
Add jitpack to repository
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
implementation 'com.github.Lucem-Anb:shake-detector:0.0.1'
Create a new shake detector where you want
new ShakeDetector(this, new ShakeListener() {
@Override
public void onShake() {
Log.d("shake", "##### Shaking it #####");
}
});
kill listener stopListening()
start listener startListening()
set intensity of the shake setShakeThreshold(float)
set time difference between two shakes setMinTimeBetweenShakesMillisecs(int)