Background Tasks Extension [3.8 A] 🥳

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: → 3.7 A
Last updated: 2021-07-19T18:30:00Z

Beta testers and helpers

@rizu @themaayur
@vknow360 @Mohamed_Tamer @WatermelonIce
@Hrichik_Mazumder @AryanGupta @Know_About_IT @PratushRoy


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

  • Creating a component


    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


    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


    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


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

  • Creating a variable


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

  • Making a delay


    Does a delay in Milliseconds. You can use this block between functions and tasks. This will not affect the UI of the application.

  • Making value from code or text

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

  • Resolve activity


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

  • Finish task

    This block will report to the Android system that the service and tasks are completed. Gives an advantage by saving the system’s resources. Use true as the parameter if you want to remove the foreground notification.

  • Start the service


    The service will be executed with its Id and latency in MS. The required network takes the following input:

    • ANY

    If you want your service to be executed in foreground mode then you can check it to true.

  • Configure Foreground


    Sets the title, content and subtext for the foreground service.

    Icon codes list: Android - developers

    There will be more methods added soon, like media notification.

  • Cancel the service


    Cancels the service by the given service ID.

  • Register for events


    Registers the event and calls the function id with the parameters. They can be accessed like {0%}. Index starts from 0.

  • Destroy component


    Kills the component at the time in MS and stops all the events.

  • Kill events


    Stops all the tasks.

  • Create on UI thread


    Creates components on UI. By default, they have created ASYNC. It’s very important to use this block if you’re using the Clock component, firebase and others.

  • Extra function


    The extra function is to compare objects and call the respective function Id. To know more about this click here.

  • Get pending tasks IDs


    In the format of a list, returns the pending/running tasks IDs

  • Reset task list


    Clears the task lists and all the functions (Create components, functions, events) and others.

  • Restart after Kill


    When the service is killed, this property block will be to indicate if the service needs to start again. The restart time depends on the System.

  • Periodic tasks

    Periodic tasks will run the service with the given interval with a minimum interval which is 15 minutes (after Android oreo). This functionality cannot be used with latency. Latency should be set to zero.


  • Flags feature

    • Flags are to pass any extra values or to change the behaviour of the service. There are currently three flags.

      • FOREGROUND_IMPORTANT Marks the foreground state of the service as important using the internal API.

      • IGNORE_FIRST_PERIODIC_RUN Ignores the first periodic run which gets immediately fired when the service is started. Make sure to stop the service before starting it again if you are using periodic tasks, else it may misbehave.

      • ACTIVITY_NO_KILL The flag is to stop the tasks (like the player) from being killed when the app is alive and the service is being killed.

  • Alarm


    A block to start the service with the exact instant provided. ID is the service Id that will get started when the alarm is fired.

  • Repeating alarm


    Sets the repeating alarm for the service with the Id. Time is the instant. Interval is the time between each repeating alarm.

  • Cancel alarm


    Cancels the pending/ongoing alarm. Also, cancel the service by CancelTask block.

Know more about internal features here.


This extension was made possible for all platforms by Rush:

Open source


The extension is free for everyone to use!

Version 3.8A
Download extension:

com.kumaraswamy.tasks.aix (469.0 KB)

Other version(s)


Download extension (Click) :kodular:

Download extension (Click) Alternative link

Previous version (2.0)

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

3.0 Version

This version works with every platform.


Bug fixes and improvements

com.kumaraswamy.tasks.aix (431.1 KB)


Bug fixes and improvements

com.kumaraswamy.tasks.aix (455.2 KB)


com.kumaraswamy.tasks.aix (452.5 KB)


com.kumaraswamy.tasks.aix (448.0 KB)


com.kumaraswamy.tasks.aix (467.4 KB)


com.kumaraswamy.tasks.aix (468.3 KB)


com.kumaraswamy.tasks.aix (467.6 KB)

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 :smiley:

Kumaraswamy B.G


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


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)


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.

How To Set Property Of The Component ?

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

1 Like

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.

1 Like

Share your aia file I will check it.

1 Like

download_background.aia (627.2 KB)

New update coming soon!


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 ?


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


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

1 Like

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:

1 Like