Describe how Android input system designed.
Describe the ways to make input event(such as touch, key press, ...) on Android in programmatic way, not manual way.
This can be helpful for some people thinking about Android remote control or test automation.
12. Android Input System
Human
Device
Firmware
Device Driver
File System
Input Manager
Service
EventHub Input Reader
Electrical signal
HID or interrupt or ...
linux input event
(linux/input.h defined)
/dev/input/
13. Android Input System
Human
Device
Firmware
Device Driver
File System
Input Manager
Service
EventHub Input Reader
Input Dispatcher
Electrical signal
HID or interrupt or ...
linux input event
(linux/input.h defined)
/dev/input/
14. Android Input System
Human
Device
Firmware
Device Driver
File System
Input Manager
Service
EventHub Input Reader
Input Dispatcher
Window
Electrical signal
HID or interrupt or ...
linux input event
(linux/input.h defined)
/dev/input/
15. /dev/input - getevent
● See input device[s] information
$ adb shell getevent -[l]p [input
device file path]
16. /dev/input - getevent
● See input device[s] information
$ adb shell getevent -[l]p [input
device file path]
● See live events
$ adb shell getevent -[l]t [input
device file path]
33. monkeyrunner
One weak point: drag
void drag ( tuple start, tuple end, float duration, integer steps)
Simulates a drag gesture (touch, hold, and move) on this device's screen.
Arguments
start The starting point of the drag gesture, in the form of a tuple (x,y) where x and y are integers.
end The end point of the drag gesture, in the form of a tuple (x,y) where x and y are integers.
duration The duration of the drag gesture in seconds. The default is 1.0 seconds.
steps The number of steps to take when interpolating points. The default is 10.
34. ash: ash is a shell
Devices Control Program Like a shell
35. ash: ash is a shell
Devices Control Program Like a shell
Use monkeyrunner for Android control
36. ash: ash is a shell
Devices Control Program Like a shell
Use monkeyrunner for Android control
Provide real-time function test recording feature
37. ash: ash is a shell
Devices Control Program Like a shell
Use monkeyrunner for Android control
Provide real-time function test recording feature
Google HackFair 2012