[Discontinued] Background Tasks [4.1] πŸ₯³

Extension 3.0 A :hugs:

  • Re-continued the extension :smiling_face_with_three_hearts:

  • Added event blocks that can call functions.

  • Component support (The extension doesn’t let any component like (example: player) kill itself when the app stop or destroy)

  • Foreground support that will let you run apps like a music player!

  • Important: Stabilized much more! The extension supports firebase, other components like clock etc!


Demo tutorials

I have made some demo blocks that will work!

  • Web demo

Here are the demo blocks to work with a Clock, Web component, and Kodular’s default Notification component!
We get a β€œthought”/β€œquote” from the web every 10 seconds when the CELLULAR data is turned on and then show it in a notification!

(Make sure to use Resolve activity block!)

Demo video: https://youtu.be/c43EKQlaFJ4
PerfectQuote(1).aia (455.9 KB)


  • Foreground music player

Here we play music from the music player in the foreground mode state so the music doesn’t stop or lag while starting or while the app is sleeping.

If you use self as a name and exit-foreground has a function name in the CreateFunction block that means we’re stopping the foreground service.

If you’re supplying true as the parameter, that means you want to remove the notification that appears while the service is running.

We register an event here for the music to end. When it does end, we will kill the music foreground service.


  • Firebase simple demo

    Here, after 5 seconds of latency, we will send a value to the firebase database of value tag text.


  • Upcoming features

    • Possible interaction with the main application from the service.
    • Periodic tasks (normal job service) that help you execute tasks frequently.
    • JSON input which will allow you to take the input tasks as JSON and execute it.

  • Question: Why we are calling the Initialize block of firebase?
    It’s because the firebase components need to re-initialize this way when we use it this way (dynamically).
    It’s the same for components like LocationSensor and others as well.

  • Question: Why components on UI thread?

    It’s because components like Firebase, Clock and other components MUST be created on the UI thread to initialize. This thread consumes a little more time to create components than default ASYNC. The extension will wait for the creation of the component as in the earlier(Ai2 thread) some days back issue.

  • Question: Will it work on Android 5?

    Yes, it should work, at least most of them. It may be late for the system to create a service but should work; as the test on Android 5.1.1


34 Likes