I am developing a mobile application to ‘motivate’ user to not use their phone.
The user checks-in, and while checked in, they should not using their phone and receive points for every x minutes of not using their phone.
While this works, with using Screen.sleepTimeout = SleepTimeout.NeverSleep; so the application never enters the lockscreen.
But, offcourse keeping the screen active, this could cost alot of battery. It would be nice to check wether the user clicks their home-button (to go to the desktop) or just locks the screen when the application is still active.
Both actions send a applicationDidEnterBackground. I want to know if the user activated the lock-screen (to keep them checked-in) or the user did something else like go to desktop (so i can check them out and they stop receiving points)
Maybe there are other ways to detect if the user is doing something with their phone other than use this app (i.e. make a phone-call, read a message, open another app?)
Yes, but both focus and pause get called in both situations (sending app to background or entering lockscreen).
i’m thinking to keep the application alive, and just face the screen to black to preserve some battery.
It would be nice if i could detect any user-activity on the phone outside of the app, that would make this easier