Open Source • Background Tasks: Itoo 🚀

What exactly do you expect the example to do?
It does not much, see again the documentation

The above example demonstrates how properties Sensitivity and Minimum Interval for the Accelerometer Component is saved and reapplied in the background.

You probably like to do something else? What exactly?

Taifun

I have a question.
I am converting my app to service running in background by Itoo extension.
My app includes two Clock components that I have already rearranged to trigger in background by RegisterEvent. Now I have this event too, that is triggered continuously by one of background Clocks:

Unfortunately my app does not work, then I figured the reason out: I forgot to transform this Event block also to make it trigger in background, as per Kumaraswamy's guidelines. But such Event includes a parameter (text read from file): how I would be supposed to convert it to background event? All examples I have seen do not include any parameter in the Events used.
Thanks in advance for any help.

the event handler you have to create must have the same number of arguments, in this case the argument text

Taifun

I really need for help.
After applying last Taifun's suggestion (thank you again, Taifun), I just finished converting my app to background service. Unfortunately, my app is not fully working. Long story short, my app continuously checks and fetches a file generated by another app and containing the working time marks (ins and outs), in order to calculate my working time spent and show it in a notification message. Here below the blocks of my app:

As core of my app, there are 3 events triggering in background (highlighted in yellow):

  • one main Clock Timer, that sets the rate of check and read of time marks file
  • the read file Event, in charge of times calculation (including a check when it is time to stop the background service)
  • a secondary Clock Timer, for a delayed stop of the background process.

Since the size of my app is quite big, I highlighted (in red) also the sections to focus and concerning my problem. Background process stopping action can occur in 3 ways:

  • by pressing the button in the interface of the app
  • by pressing the button in the notification message
  • programmatically, when - based on times calculation - my app decides that the moment has come to stop the background service

The malfunction is related to the buttons (in the app interface and in the notification message): when pressed, the service does not stop, but it keeps running. On the other hand, programmatical stop of the background service works like a charm.
I post here a video of my app showing the problem (the app visible at the beginning of the videoclip is that one producing the working time marks file):

Any help will be very welcome and appreciated. Thanks in advance.