0

I'm trying to access my android device from a web app. I send coordinates from the web app and I want to do a click on long press action on a view at that position.

Is it possible to do that? I think it's possible to get the coordinate of a view and maybe I can store coordinates of few views in an array or something similar and if the coordinate from the web app matches one of the views' position in array, I can do some action on that view..like clicking a button.

So can I click a button, knowing its coordinates?

I know this is quite far fetched, but I want to try. I'm able to view my android device on the web app. Now I'm trying to access it. Sorry if this sounds stupid.

ANY opinion on this would be appreciated.

1 Answers1

0

You should see the following two answers.

  1. The first one is quite straight forward but requires rooted android phone:- Simulating touch event using su

  2. The second uses motion event. In this first you check if the view recieved the event and if it did ,you can use dispatchEvent() function to send the event:- https://stackoverflow.com/a/4692133/1375020

Community
  • 1
  • 1
Nishant
  • 575
  • 4
  • 15
  • thanks a lot man. i will check it. i will mark as correct after a while so that other people can look and suggest some ideas. thanks a lot –  Apr 13 '16 at 12:19