I am working on an application that controls the use of the phone (in particular, what time it will be used). Currently, I am registering the time of phone calls, SMS messages, MMS messages, turning on the screen, turning off the screen and unlocking keygaurd. Now I want to determine when the user performs any interaction other than those listed above. How:
1) Use of the application (detection when the application is launched by the user and / or when it is actively used by the user)
To do this, I played with the Activity Manager, but it seems to be not a good way to get the information I need. It contains information about what is in the foreground, in the background, and what services are running, but it does not have information about the amount of use, time of use, application launch time, etc.
2) General interaction with the screen (detection when the user interacts with the screen in any way)
I have yet to find some way to detect any form of general interaction with the screen or keyboard, while my activity is not in the foreground. Any help here would be greatly appreciated.
3) Other (I am open to other "events" that will represent the user interacting with the phone)
I am open to other ideas of what I might find when a user activity is detected.
source
share