Open Source β€’ Background Tasks: Itoo πŸš€

How often does the file content change?
You might want to elaborate, what exactly you are trying to do

Taifun

The data is streamed nicely thankyou taifun
The path is there because i need to check that the blok is functioning by saving in other places hehehe

you can't write a file to the ASD of another app, in this case the companion app...
try to store it in shared storage, for example /Download/locationj.txt

Taifun

The problem continues ican store the data using save file to dummy
IMG-20240202-WA0005

But i got error on clouddb the list is 0

please show your complete blocks of your Itoo setup
Taifun

I did try moving the cloudb into three event handler but it seems the clouddb blok not sending data

Here is the aia file
Bgtest.aia (70.4 KB)

Note: the location.txt content is changing every second

One last question is it possible tosend data via clouddb using itoo kuwaraswamy extension???
If so possible i will continue experiment with this ext
If not i will try another method sending the data.

Thank you
Cloud

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Yes, but Inever tried it

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Sorry if my method of asking for help is not clear maybe iam whispering :smile::smile::smile:. Then again thank you for your kindness helping me with the first step.

Still strugling with sending clouddb blok😭

I'm on mobile, so I can't check your aia file
If you want help from me, then provide a screenshot of your relevant blocks
Taifun

help please did everything as iknow of but still the clouddb store value is not functioning but if i replace with file1 savefile block the file is updated correctly

you registered the Clock1.Timer event and the File1.GotText event
and you use CloudDB.StoreValue block, this looks fine
later when you start your app again you theoretically should find some value in the CloudDB

where does that file come from?

I now prepared an example for you


Bgtest1.aia (70.7 KB)

unfortunately storing a value in CloudDB gives an error, see logcat output here

so the CloudDB properties have to be set in the blocks for Itoo to work...
unfortunately this is not possible with the CloudDB component, you only can set it in the designer... so it looks like you currently cannot use it together with Itoo... use another database instead...

Taifun

Thanks for the logs... Taifun...

Components like CloudDB and Firebase require some additional initialization invocations done to be ready for use in the background.

Itoo yet does not manually intervene in this matter at the stage of component creation.


Once I get time, I'll do my research to extend the capabilities... yet locked....

Thank you all kuwaraswamy for this awesome ext
And taifun for enlighten the day
Then waiting for the next stage perhaps​:face_with_hand_over_mouth::face_with_hand_over_mouth::face_with_hand_over_mouth:

where does that file come from?

I store the data using another app with capabilty background cuz mit location sensor cant do live data stream in background

You probably have missed my locationservice extension

I'm currently working on implementing itoo functionality...

Taifun

Can i have a test of your extension. just to make sure your ext can send live to clouddb in my phone, Before buying full version

No you can't... the sane restrictions also apply for my extension...
In case ther iis a method, which uses the web component to connect to CloudDB, then it would be possible...

Taifun

In the meantime i think i can do store property in list method and fetch the data when app is alive that is possible right.
Or broadcast block.
Its not live data.:pleading_face::pleading_face:

I need help tracking down a timing/out-of-sync problem that I have illustrated via the attached simplified case [please ignore certain text that would apply to the app that it was derived from :frowning: ]

Here is the aia and blocks (sorry blocks are so small, I used blocks editor save as image option):

DataMinder_ButtonCase.aia (903.1 KB)

The troublesome behavior centers around the NotificationStyle1.ActionNotification with 3 user response buttons and the button response event NotificationStyle1.CallbackButtonAction, which is registered (from 'run') with itoo.RegisterEvent and procedure NotifyStyleCbButtonProcessing.

Initially the Clock.Timer event TimerInterval is 20 sec (20000). When the app starts and "Start" is touched, about 20 secs later the Timer event processing issues the following notification showing the time issued and the value of the TimerInterval (ignore the text that follows):

The user is presented with a choice:

  1. "Half" - Halving the TimerInterval
  2. "Double" - Doubling the TimerInterval or
  3. "20000" - Setting the TimerInterval to 20000.

If "Half" is selected two or three times (reducing the interval to 5000 or 2500), and then "Double" is selected the same number of times, the TimerInterval does not return to 20000.

Evidently I have done something(s) that does not assure synchronous behavior.

This is mitigated (perhaps solved?) by the introduction of Notifier1.loginfo messages which are "disabled" in the blocks.

What have I done? not done?

Kind regards,
Randal

Debug your logic using Logcat. To find possible errors of your blocks in the background, let me suggest to filter the logcat output for the tags, Notifier , ItooCreator and System.err

Taifun

1 Like

I think I have done about all I can to sort this one. I may have one more idea in me :-), but I am not hopeful :frowning:

Below find the updated the test case code and blocks image.

I have also included an annotated logcat output filtered on several character strings grep -e %%% -e TimerInterval -e Notifi -e System.err -e CallbackButtonAction .

The notations in the logcat files (included below) trace the following behavior:

  1. App "Start" pressed
  2. "> adb logcat" begun
  3. Timer fires after initial "Start" interval of 20 secs (reschedules for 20 secs)
  4. User selects Notification "Half" (next inerval = 10 secs)
  5. Timer fires after another 20 secs (reschedules for 10 secs)
  6. User selects Notification "Half" (next interval = 5 secs)
  7. Timer fires after 10 secs (reschedules for 5 secs)
  8. [no user input to Notification]
  9. Timer fires after 5 secs (reschedules for 5 secs)
  10. [no user input to Notification]
  11. Timer fires after 5 secs (reschedules for 5 secs)
  12. User selects Notification "Double" (next interval = 10 secs)
  13. [With no further user input, within ~30 ms Calback processing executes doubling the interval twice (10s ecs x 2 x 2 = 40 secs)
  14. Timer fires after 5 secs (reschedules for 40 secs)
  15. App "Stop"
  16. adb.exe logcat - stopped

See attached -hidden.pdf file.
DataMinder-wlogs3_20240210-%TimerNotSysCallonly-hidden.pdf (82.4 KB)

To see intermediate/additional filtered logcat entries, see un-hidden rows via:
DataMinder-wlogs3_20240210-%TimerNotSysCallonly.pdf (97.7 KB)

Unfiltered logcat entries are hare:
DataMinder-wlogs3-51-53.txt (71.2 KB)

What I cannot fathom is #13, above: why does the ButtonCallback execute two additional times when there is/was no further user input to the NotificationAction window.

It is as if, when no user input was made (items #8 and #10) that these CallBack "events" were held and then were executed immediately after the expected one (#12), with the last user selected action Button (Double) being used. I have tried many ways to cancel the NotificationAlerts that were "stale" not responded to (see blocks). But they seem to stick around and then mis-behave.

Any help would be appreciated,
-Randal

DataMinder_ButtonCase.aia (903.6 KB)