S Stichler Active Member Licensed User Oct 13, 2018 #1 Hello all, I'm writing a Pet game for my kids and I need to be able to have things be monitored even when the kids are not using the app. Things like the pets hunger level and maybe even have a notification sent to the phone when pet is hungry. Can someone steer me n the right direction to find out how to do what I need? Thanks.
Hello all, I'm writing a Pet game for my kids and I need to be able to have things be monitored even when the kids are not using the app. Things like the pets hunger level and maybe even have a notification sent to the phone when pet is hungry. Can someone steer me n the right direction to find out how to do what I need? Thanks.
npsonic Active Member Licensed User Oct 13, 2018 #2 You could just create one file that contain millis from everything you want to track and one timer that reads the file for example in 1 minute intervals. If Datetime.Now is more than you have set into file then you can take proper action and update new millis into file. Last edited: Oct 13, 2018 Upvote 0
You could just create one file that contain millis from everything you want to track and one timer that reads the file for example in 1 minute intervals. If Datetime.Now is more than you have set into file then you can take proper action and update new millis into file.
S Stichler Active Member Licensed User Oct 13, 2018 #3 Ok but what about when the kids close the app will this still run? Upvote 0
npsonic Active Member Licensed User Oct 13, 2018 #4 Stichler said: Ok but what about when the kids close the app will this still run? Click to expand... You can declare timer from Starter service, so it shouldn't get killed. It only matters if you want to create notifications from background. When everything is stored to the file you can easily read the file next time when app is opened and calculate how much time has passed from last actions. Upvote 0
Stichler said: Ok but what about when the kids close the app will this still run? Click to expand... You can declare timer from Starter service, so it shouldn't get killed. It only matters if you want to create notifications from background. When everything is stored to the file you can easily read the file next time when app is opened and calculate how much time has passed from last actions.