0

I want to click at a particular location outside my app whenever "volume up" button is pressed.

So I thought of creating an android app whose service will indefinitely run in background. The service will be responsible for performing click on the screen whenever "volume up" button is pressed.

I need help with the code to perform click at a particular location on my screen.

Akash Karnatak
  • 678
  • 2
  • 7
  • 16
  • Does this answer your question? [How can I reliably simulate touch events on Android without root (like Automate and Tasker)?](https://stackoverflow.com/questions/50775698/how-can-i-reliably-simulate-touch-events-on-android-without-root-like-automate) – Akash Karnatak Jan 01 '20 at 12:10

1 Answers1

1

I don't think you need a service for this. Just listen for the Volume Up button event. Look into this Android How to listen for Volume Button events?

Now About locating the points for clicking you can take help from this How do android screen coordinates work?

And for performing clicks Is it possible to simulate a click on the screen in Android?

anshul
  • 982
  • 1
  • 11
  • 33