摇动设备推出的Android应用程序
问题描述:
我们如何可以启动,只需摇动设备的应用程序?我想要做类似的应用程序Appshaker的东西。
How can we launch a application by just shaking the device? I want to do something similar to the app "Appshaker".
答
从一个活动,您可以使用的SensorManager
来检测抖动,随即反应过来该抖动。这就是AppShaker一样。 这里是展示一种方法来检测抖动的示例项目。
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.