In the instrumentation class the android api says
“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
Does this mean i can capture all UI generated events as a result of a user’s interaction. For example can i capture the motion and keyevents that are generated when a user interacts with the 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.