Background Tasks extension 2.0 A [Experimental]

An extension to create components, call functions or tasks in the background and when the app is alive with various features!

Extension version :appinventor: :kodular: → 2.0 A
Last updates: 2021-04-03T18:30:00Z


Beta testers and helpers



Documentation

Here are the documentation of all the available blocks. If you have found a mistake then let me know about it. :smile:

  • Creating a component

    03.04.2021_12.15.46_REC

    Creates a component. No matter if the app is running in the background or the foreground. All you need to do is to specify the component source name and the name which will be used to invoke functions and do other stuff.


  • Creating a function

    03.04.2021_12.16.58_REC

    Creates a function of the component ID specified. Specify the component ID and the values. To access the invoked result use the ‘invoke:result’ value to store it in a variable and then access it using the extra value block.


  • Calling a function

    03.04.2021_12.19.38_REC

    Calls the created function using the function ID. Make sure the function of the specified ID is created before using this block.


  • Call a function multiple times

    03.04.2021_12.21.58_REC

    Block to call a function specified number of times with the interval between each calls. Make sure the function of the specified ID is created before using this block.


  • Creating a variable

    03.04.2021_12.24.38_REC

    Creates a variable with the specified value and the variable name which you can use it on functions.



  • Making a delay

    03.04.2021_12.51.19_REC

    Does a delay in Milli seconds. You can use this block between functions and task. This will not effect the UI of the application.

  • Making value from code or text

    This block helps you make value from invoke result, do things. The value from it will be executed at the invoke function.

  • Resolve activity

    03.04.2021_12.57.13_REC

    Its strongly recommend to use this block. Mostly on Chinese devices which requires additional permission to run tasks in the background.

  • Finish task

    03.04.2021_12.59.18_REC

    This block which will report the Android system that the service and tasks are completed. Gives advantage by saving the system’s resources.

  • Start the service

    03.04.2021_13.03.19_REC

    Starts the service with the given service ID. The instant is the time which you can from clock component. The services will be executed one after the other and not at once.

  • Cancel the service

    03.04.2021_13.05.22_REC

    Cancels the service by the given service ID.

Extension

This extension was made possible for :kodular: odular by Rush:

Open source

Download

The extension is free for everyone to use.
Extension must not be redistributed in other communities.

Other version(s)

Download extension (Click) :kodular:

Download extension (Click) Alternative link

Latest version


Extension specially for Kodular: com.kumaraswamy.backgroundtasks.aix (377.2 KB)
Alternative dowload: App Inventor Community

About extension

If you’ve found any bugs, issues or something wrong in this post then lemme know about it. Suggestions and improvements are appreciated :wink:

Thanks,
Kumaraswamy B.G

39 Likes

I am trying To Run Download In background but When I starts the service then my app is stopped

Blocks

BTW, Thanks For The Extension :heart: :heart:

The other extension may not support it. You will need to debug blocks you’re self. Remove some blocks and test again. If it works continue and go on. These hard operations may not work with the extension as of now. (Maybe until next update)

1 Like

I collect data from my website to my app as shown in this img:

but i want to notify user when ever i change my data that the app receive ( if the app is in background or close ) as shown data is receive in label 2.

Now i want to use a background extension to process the background function and show notification when ever receive data is change.
I am using the free background extension.But no idea how to start and use.
Screenshot_3

How To Set Property Of The Component ?

How to set it with firebase, if firebase value change show notification.

You should use invoke function block to set or call functions.

First I recommend you to do simple GET request and do some experiments :slightly_smiling_face:

Great extension.

Share your aia file I will check it.

1 Like

download_background.aia (627.2 KB)

New update coming soon!

5 Likes

Can I send notification from firebase by running firebase in background
I want onData Change block to run in background and when data changed of firebase db i want to show notification title as tag and message as value

Is it possible with this extension ?

1 Like

You can use default block added with firebase called when value changed. If not you can use clock timer to check the data for a particular period of time or every second

1 Like

Use the same logic using the web component with events :wink:

But how we will know what should we type in the text…

The extension should be little bit simpl to understand

1 Like

Screenshot_5

We are meaning this block only.If any data changed in firebaseDB immediately this block will get triggered So you have to design remaining blocks what to have to happen

Just use the logics, create a component, invoke a component, do things with it’s result using save block and more. I will be posting some examples here soon. By the time you all can go through the posts here: