Shake the device to launch an application in Android

前端 未结 1 2080
一向
一向 2021-01-01 00:45

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

相关标签:
1条回答
  • 2021-01-01 00:47

    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.

    0 讨论(0)
提交回复
热议问题