[Discontinued] Background Tasks [4.1] 🥳

How to use this extension in MySQL Storing And Getting

1 Like

Please make video tutorials on ‘how to use these blocks’…i still don’t understand it fully

1 Like

Opened at OP’s request

3 Likes

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: Quotes app Background Tasks - YouTube
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

Wow. Finally it will be possible to write Firebase logic with java instead of javascript in webviewer <3

EDIT: Ok, you just show us an example for manipulating values of objects with your extension :smiley: By the way thanks for giving us opportunity to have background extension for free!

3 Likes

Hello, everyone i need your help because I am a beginner and I would like thanks to your application to send data continuously from the phone such as the number of steps, the time … But despite everything I see I can’t figure out how I can do it. So I will need you to show me an example and how I can please do it.

2 Likes

Very Nice Extension @Xoma
It helped me alot !

2 Likes

Thank you for the effort you put into this wonderful work :heart_eyes::heavy_check_mark:

3 Likes

Hello, @Lunodiamonse, it is possible to use the extension with the foreground service (even the app is closed completely) and send data to the database like firebase, I’ve prepared a demo blocks for you:

blocks(11)

Herewith the foreground service, we are creating a pedometer and firebase database on the UI thread, and registering an event for simple walk steps and uploading the data to the firebase. Foreground service is important as of now because the pedometer may stop working when the app is killed.

Just checked it, works perfectly fine even if the app is killed :blush:

FirebaseDemo1.aia (456.5 KB)

Here is how the foreground notification appears.

Important: Redmi, hawei, phones need auto start permission for non foreground service.

1 Like

Hello, Still learning, using this block in the background (without foreground) is now very simple to do!
Sorry for the very very late reply lol :crazy_face:

Here are the blocks for listening to data change in the background of the firebase DB! It’s just easy! :smiley:

(Note my connection in unstable so it may flood sometimes.)

2 Likes

Can I get tag and value of when data changed with this extension ?
Amazing update :star_struck::star_struck:

2 Likes

Very happy :blush: that you continued your amazing work ¯_(ツ)_/¯

3 Likes

Yeah sure! Look into my blocks for listening data change!

You may see this in one block {1%} which means the second value of the event or the changed value! You can use {%0} to get the tag also!

25.06.2021_10.06.26_REC

The {%0} means the tag event value and {%1} means the value of the event!

5 Likes

Can you give some demo aia???

1 Like

Here is one AIA for pedometer…

This for showing quotes every interval…

:sweat_smile: Here are they

2 Likes

Ok thank you once again. i will try.

3 Likes

Can anyone of you can say how to do this code in background


1 Like

You should instead try out some of my demo blocks rather than asking for blocks, they are mostly doable with the extension.

2 Likes