Great extension. @Taifun is a magician! Actually, it is possible to get information from the TinyDB when app is in the background, no need to send data to the server. Below I will show my solution how to get the last position every 1 second in the background, show the notification once and stop background process after 10 seconds.
Firstly, we need to define namespase of TinyDB and TaifunLocationService tag, where coordinates will be saved. Pay your attention on the Namespace of TinyDB1. It must be "TaifunLocationService". After that we should start the Location Service.
Next - Create an background process. It may be created by any event, in this example - a Button, but in my app I'm using TaifunTools extension, which looks for app's activity and starts this Service when activity status become "stop".
Next - we are defining some variables for background process and periodic event, which will trigger the special procedure every 1 second.
The following images will be parts of the "back_step_2" procedure, which is started periodically by the event we defined in the previous step. The number of blocks is large, and, so to prevent microscopic letters on images, I divide the images into parts, in which you will see the block from the previous part at the beginning and the block from the next part at the end. Well, let's continue.
You can use TinyDB with location data to store another data, which can be used in background. But, values of tags MUST be single - without any spaces, commas, "&" and "-" symbols, because they used for parsing. If you need to store data with "&" and "-" symbols, replace them to another in parsing blocks. Spaces and commas are using for parsing obligatory.
That's all.
Maybe my parsing procedure not ideal, but it works.
Here I'm attaching aia file with blocks above. This file without TaifunLocationService.aix.
This aia contains some free extensions:
NotificationsStyle extension
Itoo extension for background tasks
KIO4_Terminal extension
aia file with solution:
GetCoordsFromTinyDB.aia (114.6 KB)
BTW, @Taifun, how often extension add data to the TinyDB? Is it equal to