Background Tasks extension [3.8 A] 🥳

Supercool extension, been waiting for this from months...


Is there any list of components, functions and values that can be created in the background?

I do not have a list of components which can run in the background but some components like the Player cannot run in the background. You will need to use something alternative to that.

1 Like

Thank you for the extension Kumaraswamy.

I am testing and trying to learn how to use the tool.

I discovered the example app must be run as a compiled app; not in live development with Companion.

You said

This still seems to be true. The extension cannot be used with blocks that have an Event handler like


LocationChanged( latitude , longitude , altitude , speed )
Indicates that a new location has been detected. Speed is reported in meters/second Other values match their properties.

StatusChanged( provider , status )
Indicates that the status of the location provider service has changed, such as when a provider is lost or a new provider starts being used.

I hope your are able to enable that feature. :slight_smile:

I am testing on a Samsung A10 Tablet using Android 8.1. When I run the example and press Start, it produces an audible note (indicating Tasks is enabled); then it does not appear to do anything. What is supposed to happen? Pressing Stop, quits the Task (the app's icon disappears).
After clicking Button3 (Create component); nothing seems to happen. What am I not understanding?

What causes confusion is the example uses two extensions; your Tasks and the Notification. More explanation would be appreciated. Thanks :slight_smile: When you add more features, this extension should be great.

Perhaps someone who has discovered how to use the extension could please post another example showing how to use the tool?


I came across this extension by @Taifun that can run Location Services in Background
It may not solve your problem completely but surely can help :blush:


@SteveJG This extension does not make it possible to receive real-time alerts or motion detection while running in the background. A → Foreground service is required for this, as is the case with Taifun's Location Service extension.


Thank you for the link Kaustubh! :slight_smile: Taifun's extension works quite well with the LocationChanged Block. The app I built with it continuously records locations while the app screen is asleep, however, the extension is not yet able to provide a Notification while the app screen is asleep. I was hoping Background Tasks could do this. Not yet. :frowning:


Is it possible to call and run a procedure in background?


From the description of the extension:
"A notifier will be displayed while the location service is running in the background."

If you want to display a Notification when the device is in idle (sleep) mode (screen off), you can use my extension:

1 Like

Hello all, create a component button is used here to save all the tasks which will be executed when the service is started. The InvokeComponent has a parm called time which means the time in milliseconds the function will be invoked. All scheduling is done Asynchronously. That means in the compiled app you will need to click on create the component and then the start service button. Note that the invoke time should not be over or the time given should not be passed to the extension to work (In a simple way you will need to start the service before time is over). If the time is already passed then I extension simply ignores the function not to make the app crash or to stop the service.

I have already made a topic here that to help with the issue but not yet got a reply which solves:

It is possible to make events for a specific component for example a clock. But do not find it possible to make it for all the components created dynamically.

It is possible to keep updating or tracking the user location, just need a block that can directly return the details, this can be repeatedly called until a specific time, delay and interval by using the executeFunction block then saving or uploading the data. But please wait for the next update.

1 Like

Is it possible to call and run a procedure in background?


I don't find it possible to do it.

Thank you for the explanation. Got it! What was missing was is that is necessary to press Create component prior to Start. :slight_smile:

Certainly. Will follow the development. :grinning: Thank you.


I am happy that my extension is helping people


Congratulations !!!


Thanks my old friend :smiling_face_with_three_hearts:


what tasks can this extension run? background music player? launch notification by date? launching a notification on time?

Kumaraswamy already indicated some components like the Player cannot run in the background in post #21 . He also indicated you can not use it with Event Blocks yet for any components.

Be aware, the extension is still in early stages of development. Have you tried the extension to do any tasks?

1 Like

no, haven't tried it yet. if the extension can launch the player, notifications by date and time. then eo will be the best extension

I did many tests from yesterday night. There are components like sensors, player and other things which the extension is not properly run it. I tried it with the Clock component and a notifier which shows the Now value or Now block in the clock component after every 700 MS in Background and it just worked fine. (Not possible with the current version, this is tested in the beta version of the extension, note two: tested with property blocks) Looks like sensor components doesn't work properly with extension, just they work when app is alive and the value is not updated anymore. Here you need an alternative like the extension which directly returns the value and it can be called using the extension.

1 Like