I want to create an application that takes coordinates of the device screen and simulates a finger-click on that spot. Is there a way to do such a thing through code?
Asked
Active
Viewed 1.3k times
4
-
A click on your application or is your app suppose to run in the background? – Ash Burlaczenko Feb 24 '13 at 21:35
-
My application is supposed to run in the background. – prgDevelop Feb 24 '13 at 21:37
-
@prgDevelop I have the same requirement, could you suggest me the further process to follow on? Also I found in the comments below that you are accessing the view of external applicaton, thats also my need and trying everything but didn't get the trick till now. Can you help me on that issue also? – skygeek Jun 26 '13 at 08:53
-
Hi there, I have the same needs can you please tell us how did you make it? thanks – Shilaghae Mar 28 '14 at 11:58
-
Check my answer with no root requirements. :) – Anand Varkey Philips Dec 18 '17 at 11:16
2 Answers
2
You can call onClick on specific views if that's 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

Sipka
- 2,291
- 2
- 27
- 30
-
2I want to do it on a remote view. i.e a view of an external application. – prgDevelop Feb 24 '13 at 21:42
-
2
check monkeyrunner
You can remotely execute touch events on an Android device using the monkeyrunner api.

stinepike
- 54,068
- 14
- 92
- 112