1

I would like to know if it is possible to have a process that would constantly run on the phone and would track the number of times a user taps on the screen. For example, the user downloads a game, plays and then quits the app and although he quit the app, this process that got installed together with the app will still run and all that it would do, is that it will increment a value every time the user taps on the screen and then remember the said value, in order to be used the next time the user starts the app. I don't know if this is a simple question or not but please keep in mind that I am new to Android development and I did not find any related topics on this.

Thank you in advance.

Last Templar
  • 327
  • 3
  • 19
  • This seems like it would be a security loophole, and not something that the Android sandbox would allow, but I haven't done enough research to confirm the truth behind that. – Adam Jul 23 '14 at 21:27

1 Answers1

1

Yes, it is possible. Using certain flags on your service, you can create a system-wide overlay that should allow you to catch all click events systemwide. However, keep in mind that it seems that Google have tightened up security in Android 4.x, so you may have trouble getting this to work on more up-to-date versions of Android.

For specifics about implementing this, see this question: Creating a system overlay window (always on top)

Community
  • 1
  • 1
Veselin Romić
  • 684
  • 7
  • 10
  • 1
    although I have no clue about the terms you used (being an android noob and all), this seems like something that would help guide me in the right direction. Thank you :) – Last Templar Jul 23 '14 at 21:39
  • Well, a Service is just the Android term for a process launched by an app that constantly runs in the background, whether the app is currently focused or not. Flags are, in general, things you can turn on or off when using a feature or an API. I think you'll be just fine. :) – Veselin Romić Jul 23 '14 at 21:42