Is there a way to simulate a click on the screen on an Android device using code?

I want to create an application that takes the coordinates of the device’s screen and simulates a click of a finger on this place. Is there any way to do this through code?

+4
source share
2 answers

You can call onClick in certain views if that is good for you.

View v;// or any of your view that extends View(ImageView, TextView etc...) v.performClick();//API 1 //you can use this with longClick aswell v.callOnClick();//API 15 //see documentation for these methods 
+1
source

check monkeyrunner

You can remotely execute touch events on an Android device using monkeyrunner api.

+1
source

All Articles