I want to program a little Tamagotchi for practice.
And I’m just thinking how I should do with the values, hunger and sleep.
Should I run two timers that change every 10 minutes the values, and then save it or is there a better way to do it?
I want to program a little Tamagotchi for practice. And I’m just thinking how
Share
If you only want the Tamagotchi to be hungry or sleepy while the app is running, use a Handler and Runnable. These are Android specific Timers.
If you want the Tamagotchi to change states while the app isn’t running, you need to create a repeating alarm with the AlarmManager to start the app.