Background Tasks extension [3.8 A] 🥳

I have alredy said it...?

1 Like

No, you only said:

Which issues?

2 Likes

That's was never an issue.
I have already told @Kumaraswamy a lot of times that extension will also work in Kodular if the user modifies manifest a little bit.

See this thread for example:

3 Likes

I don't know :man_shrugging:. I had confirmed overtimes before posting anything.

Yes, the extension will work if changed something manifest as you say. As the previous version of the extension is open-source, why don't you all do some experiments with this version and the previous version? I just use services annotation and have no idea about manifest as I am not experienced with it. I had thought to look at how to add manifest elements today but did not get time to do it.
:man_shrugging:

1 Like

The NotificationRepeat demo aia is not loading into the compiler. I get this error on the Designer notificationRepeat when I import the aia . Do you have any idea what the problem might be?

I am using Companion. Other aia files load without issue. Thanks.

Fixed with NotificationRepeat1. Thank you.

1 Like

This is missing from aia:

Updated version
com.sunny.LogReader.aix (6.0 KB)

2 Likes

Maybe the AIA file is corrupt. I was using @vknow360 's Log Reader to do some testing. I had removed and added it a lot of times maybe this caused the issue. I will update the post soon :slightly_smiling_face:.

1 Like

Hi @SteveJG, can you test this demo AIA file:

NotificationRepeat1.aia (404.2 KB)

1 Like

NotificationRepeat1.aia loads fine. Thank you very much for the replacement! :grinning:

1 Like


Hello,
if I want to use this extension with another component (e.g. player) what should I put here
Thanks

2 Likes

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/