Following to the received suggestions, I eventually succeeded in building a working app.
I believe worthwhile to post my example app about a basic usage of Itoo and MelonNotification, that I am going to exploit for another real project and that I hope could turn out to be useful for somebody else.
Hello, it works as it should... on the Samsung tablet. However, on the Motorola device itoo does not close down completely.
Going to the setup screen I use 'StopProcess'. Afer coming back 'ProcessRunning' even notices itoo is not running
anymore it starts again after loading the new settings.
But, after that, on the Motorola device the timer (starts web.get) does that twice in the normal time, while broadcasting the interval shows the correct time.
When I go to setup again and come back the timers fires 3 times in that time.
Again... everything runs perfectly on the Samsung device.
A reboot of the device or reinstall of the app is necessary to get the proper timing again. Is that a known bug with Motorola (or even more brands)?
Any tips to prevent that from happening?
A picture with the most important blocks. And also the aia.
If anyone else wants to test too... this much simpler example replicates the error: Every time after stopping and starting itoo the counter is incremented 1x extra every 5s. The Motorola device runs on Android 14. The Samsung tablet where the problem does not occur runs on Android 10.
Unfortunately, even though I set MelonNotification AlertOnce property to true, each time I am going to update the notification message in the Clock Timer event, notification alert sound keeps triggering and it is quite annoying.
How can I make the notification silent or, at least, make it trigger the alert only the first time?
Thank you all.
If you're working with background processes, this guide lays out the essentials really well! Running tasks smoothly while an app isn't active can be tricky, but frameworks like this make it easier. Also, for those managing projects and resources, having the right tools to store and organize data efficiently is key!
Yes that's right. But in my case that is not a problem, because I turn off my mobile phone every evening. Your exam is much more important. Here is the screen recording.
I had some pretty interesting results on my Android 14 as well, the behavior of services seems to have changed.
I observed that when you stop a service, then restart it, the service then does not begin with a new memory, it rather reuses old stuff.... I will work on this when I have some time. Thank you for the report.
I am using the version 4.4 of the extension. Anyone can suggest how can get it working?
I tried testing it on Android phone by building the apk. The apk installs but then I get to see only a blank screen and the screen gets unresponsive. I have to close the app manually.
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?
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.
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.