摇动设备推出的Android应用程序 [英] Shake the device to launch an application in Android
本文介绍了摇动设备推出的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.
这篇关于摇动设备推出的Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文