2

I want to detect when a user starts and finishes a touch gesture outside of the Android service/activity that is observing it. I can't seem to find a way to get this working; it only seems to work when the user interacts with the activity directly with onTouch methods.

The device is rooted so I am open to including solutions that would work on rooted devices but there is even less information for doing it on rooted devices than non-rooted!

mino
  • 6,978
  • 21
  • 62
  • 75
  • On non-rooted devices you just can't do that. On rooted devices you have to drop down to the Linux level and read incoming events from the touch sensor directly. – Gabe Sechan Jan 15 '17 at 16:17
  • @GabeSechan Thanks for your reply. This is what I thought. I have also tried to do this but have failed to get it working. I have tried to execute "getevent -lt /dev/input/event2" (which are touch events for my device) but I just can't seem to get it working. I'd like to print the output to the logcat currently. Do you have an example of how to achieve this? – mino Jan 15 '17 at 16:20

0 Answers0