[Discontinued] Background Tasks [4.1] 🥳

i am create notification
Firebase on datachange block
on datachange firstly check this tag in tinydb if not in tinydb than create notification and same time store this tag in tinydb

can you please give me an example of blocks with clock timer and Keep Alive Extension ?

This thread is not about Keep Alive.
Have a look at the developer’s website.
The website is here.

Hi,
Can anyone make an guide for how to store and get values from mysql. I am bit confuse how to do it. If anyone know then please share. BTW Thanks for this extension.

hi everyone
i am making an app which is a running tracker app using maps. The route of the person is tracked till the time the screen is on. When the screen of phone is made manually off the location sensor stop giving the inputs to the app and app is giving the wrong reading.

please help me
Is this extension is helpful in keeping the app running (location sensor to keep giving the location inputs) something like how the google navigation app works
and
how to use it in this case

You would probably need a foreground task and its common that apps turn of when the phone is manually turned off.

1 Like

SPLIT STRING WITH BACKGROUND EXTENSION
Hi everyone, I’m a new programmer. I was wondering if there was a way to split a string with background extension.
I have already discovered that with the integrated “split” block it is possible to split a given string (for example “hello / hello” => [hello, hello] but this doesn’t work if in the split block I try to insert a variable obtained in the background (so received with val0).
Please, I need help
Thanks friends.

Can you show me your blocks?

Hi, I finally solved it by finding another way, sorry and thanks anyway for your patience.
However, another problem occurred to me:
How to transform a string value into a number?
Let me explain: from a web request I get an answer with a text that is a number. Read the text through the “Got Text” block and access the value with “val3”. Now comes the problem: In an Extra function I access the value val3 and with the command = val3.parseInt () I try to transform it into a number however this does not work. Could you give an answer?
Thanks again for your patience

val3.parseInt() is a wrong thing, you have to use Integer.parseInt() method.

1 Like

Hi!! This looks great. I’m new using the app, I was wondering if you could share the .aia file. Cheers!

Hi Xoma!

Thanks for this extension. I am trying to build an app to use the cellphone as a detector of electrical power blackouts that sends a message to a bot when that happens. Thus, I need to run the app in the background of the cellphone. I use the extension TaifunBattery to check if the cellphone is charging or not.

I am trying to work with procedures as you indicate in this post, but I cannot get the app to execute the procedure correctly. Do you know what might be the problem?

Here is the file with the minimal project:

DetectorCortePosta (1).aia (494.3 KB)

Thanks a lot!

you are calling a function in a procedure that will not work you have to directly add blocks there, also foreground is required if you want to call the procedures

1 Like

Thanks for your quick answer! I changed the foreground to “True”.

I am sorry, I am very new to all this, could you be a bit more specific?

I have this block (currently not running in background), that checks if the cellphone lost the power connection and, if so, stores a message in a variable.

I want to run this in the background, my idea was to insert the content of this block into a procedure and invoke it. Would that be the way to go?

Thanks a lot and sorry for the long message!
Cheers.

this maybe easy to implement, i will look at it when i get time, remind me once,

1 Like

does your notifier work in codular?

1 Like

Hi! Yes, the notifier is working. If in the “.ListenEvent” I change the function “CheckBattery” for “MandarNotificacion”, it sends a notification in every change of battery status.

Thanks for your answer!

1 Like

Hi Xoma!

Just in case it makes more sense, I attach the aia file for the “PowerOutageDetector” that works perfectly but only when the app is in the foreground.

It has two main functions, which should run in the background:

  • the one I showed simplified above, which checks if the cellphone is conected to the power line
  • Another that checks if there’s internet connection. After a power outage, it waits until internet connection is restored and then sends a telegram message through a bot

PowerOutageDetector without credentials.aia (488.6 KB)

Thanks a lot for your help! :slight_smile:

1 Like

Your question is off topic in this thread…
The answer is yes, however see chapter Kodular restrictions here App Inventor Extensions: Alarm Manager | Pura Vida Apps

Taifun

Hi Xoma!

I could go a step further regarding the “PowerOutageDetector”.
I cannot access a variable that I modified in an ExtraFunction block in another block. In this case “Estado_Anterior”, I want to join the content of this variable with the telegram api address in the “set-url” function. But I get the string "{$Estado_Anterior} instead of the content.

Do you know what might be the problem?
Thanks!