Hello Everyone,
I am new to B4A and am interested in understanding how to determine if a tablet or phone is currently being used or is inactive.
Although this site is incredibly informative and I have already learned many things from it, I have had no luck googling or searching the B4A forms for a solution and was hoping someone on here could help.
I am writing an App similar to a screen saver where once inactivity is detected, I would like to start a timer and after the timer expires perform some background tasks. But I would also like to be able to stop my background operations if new user activity is detected.
I have familiarized myself with services but my problem has been finding the status/event that will tell me the status of the device.
So my comments/questions are:
1) Since there is a display setting to never turn the screen off, I cannot count on the screen always going into an off state.
2) Shen the device does go to sleep, I still need to continue to perform my background processing.
3) Since it could be a tablet, I cannot count on any phone calls being made.
4) How can I detect if a user is actively using their tablet, versus it's in an idle state(sitting with an App idle, home screen, display off, etc.)?
5) How do I deal with the situation where maybe they are watching a movie so the tablet is active, but there is no user input?
Any help would be greatly appreciated.
db
I am new to B4A and am interested in understanding how to determine if a tablet or phone is currently being used or is inactive.
Although this site is incredibly informative and I have already learned many things from it, I have had no luck googling or searching the B4A forms for a solution and was hoping someone on here could help.
I am writing an App similar to a screen saver where once inactivity is detected, I would like to start a timer and after the timer expires perform some background tasks. But I would also like to be able to stop my background operations if new user activity is detected.
I have familiarized myself with services but my problem has been finding the status/event that will tell me the status of the device.
So my comments/questions are:
1) Since there is a display setting to never turn the screen off, I cannot count on the screen always going into an off state.
2) Shen the device does go to sleep, I still need to continue to perform my background processing.
3) Since it could be a tablet, I cannot count on any phone calls being made.
4) How can I detect if a user is actively using their tablet, versus it's in an idle state(sitting with an App idle, home screen, display off, etc.)?
5) How do I deal with the situation where maybe they are watching a movie so the tablet is active, but there is no user input?
Any help would be greatly appreciated.
db