Hi All,
I am a grad student working on testing techniques for Android environment.
My current topic is to build record and replay tool.
Is there any way to capture all touch/key events fed in to a specific
application?
I tried following two ways to collect events without success:
1. I first tried to overload "dispatchKeyEvent" and "dispatchTouchEvent"
methods of all classes inheriting Activity or Dialog. The result was half
success: Events are not captured when a menu (option menu or context menu)
is appearing on the screen. By analyzing runtime information using
reflection mechanism, I found that menus are attached to their own Window.
So, events will not be delivered to a dispatch method of Activity or Dialog
classes.
2. Then, I tried to replace all Window's callback object to my proxy
object using reflection. This doesn't work either. Some events are still
missing when a menu is appearing on the screen. By inspecting the source
code of Android Framework (v16 and v17), I found that the Window class
implementation (com.android.internal.policy.impl.PhoneWindow class)
short-circuits some events directly to a corresponding event
handler without consulting callback object.
To clarify the question, I might need to explain my requirements.
- I am not interested in collecting all inputs for all applications.
Just want know inputs fed in to a single target application.
- I have the source code of all target applications. Slightly modifying
a target application is acceptable.
- I want to avoid modifying a firmware
- I know that I can always collecting raw input data from
"/dev/input/eventN". I want to avoid this option since this will be a heavy
reverse engineering work.
Thanks in advance!
Wontae Choi
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.