Previuos I put in this post:
Current are here:
Please, tell me, what about "for" loops and "if" conditions in the background procedures - should they work?
Add an argument "x" to the "procedure1"
This is NOT an example, which uses ONLY the itoo extension to read something from TinyDB and send a notification
You are trying to take several steps at once rather than do it step by step as suggested
Taifun
As Kumaraswamy said, Itoo extension unable to read TinyDB, so I'm trying to do this in another way. If everything works out I will post it here as a solution.
So, as I promised, solution for combining Location Service Extension by Taifun and Itoo extension:
"location_service" - it's my tag, defined in this block:
In this manner I can get list of coordinates, which saved in this tag.
Actually, we can get any TinyDB tag with this solution, just need to define needed Namespace.
JSONToolsVersion4.aix
com.KIO4_GetTinyDB.aix
Thanks a lot to @Juan_Antonio, for unique extension.
Thanks a lot to @Kumaraswamy , for the background tasks!
UPD. 16.06.23. This solution does not work with Location Service Extension by Taifun to get current coordinates. But, it will work with TinyDB, you can get data which written before app going to background. Here the working solution how to get coordinates with Location Service by Taifun.
@Kumaraswamy Can I create a process, using a Clock1.Timer
trigger, to perform an API call and, based on the returned json, decide whether or not to display a notification?
Yes, this sounds doable
Read the entire thread, try the examples, play around with the extension.. then put together some blocks for your task... and if you got stuck, post a screenshot of your relevant blocks
Taifun
Seems, it read the data only once when process created. After that, even with clock event it shows the same. Data is changed, but output - no...
This is probably caused because of Synchronization issues.
Since the Taifun Location Service writes data to the normal storage, this isnt regularly updated while retrieving it in the background.
Please, explain, how to kill the background process. I used the StopProcess method to stop. Notification of the process disappeared, but another notification, generated by Notification style extension continue to appear 1 per second (by Clock event). It continues some minutes after process stop. As I understand, it's a task, which can be killed by StopTask method. But how to define it's id?
I've solved this issue with another extension by @Juan_Antonio, KIO4_terminal.aix. It reads properly. I will edit my previous post about reading TinyDB.
Could you please show me your blocks again?
It's about StopTask?
No, show me all of your blocks related to background service and reading.
It's ok now after I'm using KIO4_Terminal.aix. I will prepare my solution. Please, give me information about stopping the process
Normally, the StopProcess block will stop the service and destroys the registered events, and components, does this not work for you?
It stops after some minutes, as I've described.
Do you mean it takes few minutes for it to stop?
I'll wait for you to post your blocks, so that I can take a look into it.
Can you please use the StopTask block instead in the place you are calling StopProcess?
StopProcess can only be used within the background service.