Android: Send a touch event

android, touch

Solution

This is only possible using one of these two approaches:

- Root your device

- Direct injection to /dev/input/eventX

- Using InputManager.injectTouchEvent()

- Using WindowManager.injectPointerEvent()

- Create an `AccessibilityService`. Notice that this is not guaranteed to work with all third-party apps.

Problem

In Android is it possible to send touch events to the screen? I want to programmatically toggle a button from a third party app by sending a touch event.

Original source