Background Tasks extension [3.8 A] 🥳

I am doing some tests on the Player component. The player component stops the playing music and so when the app is destroyed, the music too gets destroyed or ends. Some hours ago I did a test with @Jarlissonlira2's bit modified version of Floating view which supports my extension, where the app would show the float when the app is alive and it would remove it after 15 seconds even after the app is destroyed. Which worked well. (Tested in beta version of extension which increases support towards UI component).

You will have to stop the Player from stopping the music or you will have to make an extension with the same source of player but bit modified.

1 Like

Ok, thanks @Kumaraswamy

1 Like

I have done some changes according to the extension so the player dosent stop on destroying the app:

com.kumaraswamy.playerx.aix (17.0 KB)
BackgroundPlayer.aia (1.3 MB)

Change the path to the music path in the AIA file if you want to test it.

I have tested this on Android 9 and it played well even after destroying this :relaxed: I tried to run in on Android 10 but there was some issues setting up the source music file :anguished:

(Note: there is a minor bug, when you add the extension, it dosent appear in the extensions tab so search it in the Palette. Note two: this is not the official and recommended way if you're using other than the extension)

1 Like

Hey @Kumaraswamy how can I run a procedure in the background with this extension?

1 Like

This is not possible to do it with the extension.

1 Like

Version 1.2 A2


This release includes minor bug fixes, an improved way of performing tasks as accurate in timing tasks and some new featured blocks added. This is a stable version of the `Background - Tasks` extension than before. Feel free to report any bugs or get help here.

  • ( :white_check_mark: ) Added support to Kodular platform. You can use the same way used here. This extension was made possible by Rush also thanks to @shreyash for helping me with it.

  • ( :exclamation: ) Removed the block Logs as it was not useful or a way of doing things. You can still access them using the "BackgroundTasksLogs" tag in the Tiny DB with the default namespace.

  • ( :information_source: ) A block to directly execute the Java code as it is useful at many points:


    The code should return something in value else an empty string will be returned. You can make simple functions and call them.

  • ( :information_source: ) A block that can invoke a function directly. You can use it to reduce you're and the extension's effort.

    ai2.appinventor.mit.edu_ (30)
    Make sure the component is created and the function name specified is valid.

  • ( :information_source: ) A block that can register an event of the component. (Example timer in a clock). To make it work, the component or the extension must be alive and running in the background to make it work.


    The component name is the name of the component id in which you want to register the event. The event name is the event block (the yellow block) name. Put a created function's id in the when event socket else leave it empty.

  • ( :exclamation: ) Changes to function related blocks have been made. You'll need to update the blocks or the project may be corrupt the next time you open it.


Download

I've updated the first post. The extension should not be redistributed anywhere until necessary.


Thanks for that thirty likes friends!

13 Likes

Thank you, also works on Kodular ) :upside_down_face:

2 Likes

Publish your extension to kodular because you have added kodular support and more people can use this amazing extension

1 Like

I cannot publish there for some reason :sweat_smile:. Let's not go into that :)

1 Like

Make tutorial, How use RegisterForEvent with clock/

Hello @Chudesa_Bojii. If you need to use the clock component then it's not recommended for that long time as you want to function every day at 9 PM. You need to use the execute function block else you will need to show a notification when to click it will open the app with start value and then you need to call StopService and again shedule it. I will make a tutorial when I will get time :slightly_smiling_face:

Hey :wave::blush:
I want a delete a file in my ASD of my app. I stored some data in the form of text file in my ASD. I want to delete that file in background so that user can't access that data of my app. Can you tell me how to do ? I tried but not working :disappointed: I delete that whole block :joy: because is not working.
Can you help me!

Thank!

Can you show me the blocks you've created?

Then how should I help you :zipper_mouth_face:

I deleted because non-thing is working I am reading your document 4 times still not understand :disappointed::pleading_face:

Ok! I will again try and show

First do the thing using normal block. Then if you're stuck somewhere then get help here
xD

1 Like

Hello everybody. I'm trying to build an application that reads data from Firebase, and whenever the data (eg temperature) exceeds a certain threshold (eg 20) it sends me a push notification. even when the app is closed. is it possible to make it happen?

1 Like

Yes, it's possible but if only the component is running in the Background or is alive. You could give it a try.

Please may add, start on boot and click on "Background task", in notification panel run programm.

Yeah sure. I have alredy started working on the new version of the extension. The newer version of the extension may take a week or more and I think releasing these many versions too quickly is not good. I have also final exams going on so it will be bit more late.

2 Likes

Hello,
Sorry but I do not succeed to make the extension work on Kodular.
The companion do not support background tasks and the .apk doesn't work.
I tried on NotificationRepeat and BackgroundPlayer
Can you please explain me ?

[mod edit link removed]