Hello Taifun,
I followed your last suggestion, but I see a severe problem concerning the handling of Clock component in background and I can't understand the reason.
I simplified as more as possible my app, by stripping away all the unneeded features, and I included a notifier to show an alert message in the spots when the secondary Clock (BackgroundStopTimer) triggers and when StopProcess procedure is executed.
Then, as you advised, I set to stop straightly the service inside the buttons events, without passing by the secondary Timer.
Apparently, MainClock.TimerEnabled and StopClock.TimerEnabled instructions are effective only inside BackgroundMainTimer event; whenever invoked by buttons or elsewhere, they are totally ignored, so main timer Clock keeps running.
Here the blocks of my debug trial:
And here a videoclip showing the malfunction:
Here below the AIX project file of this debug version:
In the debug version I included the button Set All Times to set the flag AppGoingToClose?, that decides when background service and timers have to stop.
The expected behaviour is that one related to Set All Times button: the timers are properly handled and eventually the clocks and background process are correctly stopped.
On the other hand, when I use the buttons (Stop Work Notify Service in the app interface or Stop Service in the notification), background process and timers do not stop, even though they are expressedly disabled/stopped by StopService procedure. In both case, StopService procedure is invoked (see the alert messages), so why in the latter case process and timers do not shut off?
Do not use the Notifier.ShowAlert method in the background... in the background there is no user interface... for debugging use the Notifier.LogInfo method instead and check logcat
Hello Taifun, thank you again for your prompt feedback.
I would to simplify the things even more and I decided to resume my basic example app, that I used as template for the development of my actual app. Here below its blocks and AIA file project:
At that time, I tested such app on my old phone, that runs an older Android version (10 or 11) and it was working like a charm. Today, I tested it also on my new phone (Android 15 based) and I see the same exact problem: the disabling operation of the Clock (Clock1.TimerEnabled = False) and/or Itoo.StopProcess operation is ineffective, so the timer keeps triggering in background.
Therefore, it is quite strange that there is a case where my actual app stops background service and timers successfully, since it is supposed to not.
At this point, I am going to suspect that Itoo extension has some inconvenience with the latest Android versions, so it would be nice to get the opinion of Kumaraswamy as well.
Hello Taifun,
As per your suggestion, both on my old phone and new phone, I generated logcat log file of only Error level messages (adb logcat *:E) with Simple Itoo Project app running:
While logcatting, the app has been launched, then I started background process, then I closed the app, finally I tried to stop the process by the button on the notification message. On the old phone, process/timer has stopped successfully. On the new phone, as I already told you, process/timer does not stop and the timer keep triggering, so I tried up to 5 times to stop it, but in vain.
I had a look at the logs and I see errors occurring both on old and new phone, but honestly I have no clue how to read and decode these logs.
As usual, any help from your side will be very appreciated.
Could you please help me, I can't get the web component to work, only the sound works with the notification, I already checked and did the same as the documentation you did but it doesn't work for me.
This is what I need please, I'm going to send you a donation for your great work, but I can't get it to work please
What do you want to do after the Web Request? Play a sound and show a notification? Then you have to register event for Web1.GotText with 4 parameters.
Create a procedure called Web1.GotText with 4 parameters that of the event.
In fact, I performed the same procedure that you mention but it still does not work, my intention is to activate a sound when executing the web component when I get a response, but it does not work.
I had the same problem, the original file is actually a high quality picture, but it looks likes MIT servers fiddle somehow with the uploaded images and blurs them to reduce their quality (maybe for compression purpose).