6

How can we launch a application by just shaking the device? I want to do something similar to the app "Appshaker".

jithinroy
  • 1,885
  • 1
  • 16
  • 23

1 Answers1

12

From an activity, you can use the SensorManager to detect a shake, then react to that shake. That is what AppShaker does. Here is a sample project demonstrating one way to detect a shake.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491