I want to write a mood tracker for my Garmin Fenix, so I want the app to pop up after some time interval, vibrate, and ask me for my current mood. Of course, I don't want to have the mood tracker in foreground all the time, so I'm looking for a way to re-open my app from a background task.
I found two modules which seem like they could achieve this, Timer
and Background
. Background
can pass back data to the app after some time, but it can't vibrate and data transfer only takes effect once the app is manually re-opened. Timer
doesn't seem to have much effect at all, once the app is closed – at least in the simulator.
What's the best way to re-open my app after a specific period of time?
From what I understand you could do as followes:
You want to use
[requestApplicationWake][1]
.in the
onStop()
method you can register a temporalEvent.Then create this class that will be called when the event is triggered.