I would like to implement a service in Android that basically should monitor the time elapsed since the user didn't touched the screen. For example the user opens Internet or Adobe Reader, starts reading and don't interact anymore withe the touchscreen. I want that my running service know the time since the user didn't touched the screen. How can I do this ? I'm thinking at two approaches: 1. The better one : After the time is elapsed (the service is set that after 2 or 5 or 10 minutes to check if the screen was or not touched) the service query some system object for this information. 2. The not so better one (I think this could have an impact on performance) At every touch of the screen the service to be notified.
Please help. Thanks.