Shake Detection Library

If you want to detect the shake sensor,

Implement like this,  SensorManager
public class Demo extends Activity implements ShakeDetector.Listener

Class Implementation, 
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
ShakeDetector sd = new ShakeDetector(this);
sd.start(sensorManager);

Interface
public void hearShake() {
Toast.makeText(this, "Now You're Shaking", Toast.LENGTH_SHORT).show();

}


 Get the Library from this link

Comments

Popular posts from this blog

Flutter Bloc - Clean Architecture

Dependencies vs Dev Dependencies in Flutter

What's new in android 14?