简体   繁体   English

Android中的检测

[英]Instrumentation in Android

In the instrumentation class the android api says 在工具类中,Android API说

"this class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application." “该类将在任何应用程序代码之前为您实例化,从而使您可以监视系统与应用程序之间的所有交互。”

http://developer.android.com/reference/android/view/View.OnGenericMotionListener.html http://developer.android.com/reference/android/view/View.OnGenericMotionListener.html

Does this mean i can capture all UI generated events as a result of a user's interaction. 这是否意味着我可以捕获由于用户交互而导致的所有UI生成的事件。 For example can i capture the motion and keyevents that are generated when a user interacts with the UI. 例如,我可以捕获用户与UI交互时生成的动作和关键事件。 If this is possible please tell me how. 如果可以的话,请告诉我如何。 Thanks 谢谢

You can capture events via various listeners. 您可以通过各种侦听器捕获事件。 For example if you want to capture touches and gestures you can use a gesture listener. 例如,如果您想捕获触摸和手势,则可以使用手势侦听器。 Likewise there are listeners for key events, button clicks, etc. There are a few events (hitting the 'home' button) that you can not catch or see, but otherwise most can be listened for. 同样,也有关键事件,按钮单击等的侦听器。有些事件(单击“主页”按钮)无法捕获或看到,但大多数事件可以被侦听。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM