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.
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.
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
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...
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...
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.
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 ]
Here is the aia and blocks (sorry blocks are so small, I used blocks editor save as image option):
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):
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.
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
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
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:
App "Start" pressed
"> adb logcat" begun
Timer fires after initial "Start" interval of 20 secs (reschedules for 20 secs)
User selects Notification "Half" (next inerval = 10 secs)
Timer fires after another 20 secs (reschedules for 10 secs)
User selects Notification "Half" (next interval = 5 secs)
Timer fires after 10 secs (reschedules for 5 secs)
[no user input to Notification]
Timer fires after 5 secs (reschedules for 5 secs)
[no user input to Notification]
Timer fires after 5 secs (reschedules for 5 secs)
User selects Notification "Double" (next interval = 10 secs)
[With no further user input, within ~30 ms Calback processing executes doubling the interval twice (10s ecs x 2 x 2 = 40 secs)
Timer fires after 5 secs (reschedules for 40 secs)
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.
What would be the "normal" way to communicate a change in parameters to a background process that requires periodic user input ?
The blocks below show what I did that seems to avoid the multiple-queuing of unwanted Button-actions. Note the use of itoo1 database item "ActionNotificationQueued" as a flag in the notification sending procedure (LargeIconNotificationWithOptions), and in the button callback processing procedure (NotityStyleCbButtonProcessing) .
It allows only one outstanding notification to be "queued" (flag set by b/g timer processing). If it does not get cleared before the next periodic cycle (via ButtonCallback processing) , the notification is canceled, and the flag is cleared. Then on the following periodic cycle a new notification is issued.
Since I do not understand how all this works I suppose this may not be bullet proof. But I am hoping that by allowing an entire period/cycle to pass with no new outstanding notification, there will be time for any CallBack processing already started to complete, awaiting the next cycle.
Another approach (that I have not tried) is to post the same notification for user input when the b/g process is started, setting the "queued" flag. Then use Notifer (not reliable?) and SimpleToast to periodically notify the user when input is suggested (e.g., "Stop sending these notices for 2 hours!!").
At any point the user could navigate to the notification that was posted on Start and supply what is needed. This would be processed by ButtonCallback clearing the flag when done. The next periodic cycle that detects a cleared flag would post another notification and set the flag.
Thanks for any comments and help you might offer, kind regards,
Randal
Hi Randal, rather than the explanation (what you have done so far), it would also help to know what you are trying to do so far.
Also since I assume you are touching the callback button features of the notification style component, it's not guaranteed to work in the background (that's why dont use it for now).
I'll be able to take a look into this thoroughly next month.
I know you are especially busy, so thanks for the reply.
You asked:
what you are trying to do
I want to periodically check the data transport mechanism. If it is cellular, I want to notify the user and give him the opportunity to increase the time between checks or to stop checking ("snooze the app") for a certain period of time. This could help those without unlimited data plans to be more aware of their data use.
I want it to start when the phone is started.
Eventually, I want the user to be able to set various parameters that determine 1) how frequently to be notified, 2) for what reason (under what conditions) to be notified besides simply that data is in use, and 2) how to be notified (a notification, toast, notifier, other?).
Again, I wish you good success in your academic achievements and upcoming exams.