[Discontinued] Background Tasks [4.1] 🥳

I have Dmed you the aia. It is still not working.

This is how it should be. You were calling the function name “initialize” which must be “Initialize” instead. And it was needed to create components on UI thread. You had also specified the function name “start” which is just invalid…

Worked fine for me.
Let me know the result.

Note: Dont include any extra spaces and stop a service before starting again.

testsms.aia (455.1 KB)

hi, is your extension up to date with the new kodular update?
my app is giving an error

Thank you very much
I knew something was incorrect.

1 Like

Tried with the updated aia, the reading only works only if the app is in foreground (focused) only

1 Like

@Xoma

I lose my mind
I can’t get it to work … and yes, version 3.3 installed
where am i wrong?

return ORANGE instead of RED

Problem1 :-

Here you have registered the clock component then set interval and enabled it (si will start clock)

Solution1 :- I am solving

Problem2 :-

You have called 3 events at same timer as much I know it will always choose last one which Id is contain. So as timer is also started so it will start showing the notification.

Solution2 :-

I think you need to register timer event after you got from the web this may work i I solving this.

Yes, the extension is fine with the update.

Welcome!

Just to test, I enabled foreground service because the android system does not kill it often. If you are using any high-end or redmi/Chinese phones, look into the post below to solve the problem.

1 Like

The blocks look correct. What is not working?
Could you please explain to me, what are you trying to do?

Actually, this is one of the bug to fix in my to-do list :sweat_smile:
I am trying to bring the update soon.

1 Like

@Xoma

Basically this is what i want to achieve:
1 - check if a file contains the text “ORANGE” (UPPERCASE)
2 - every 5 seconds “GotText” via “Web1” and check if "val3.contains(“ORANGE)”.
3 - if true show notification “contain”

P.S.
while trying to check “val3” value it returns something like “[java.lang.string @4aa29d0b

i’ll give a try at @Bharat_Android_App_Develo suggestion

Tried with the updated aia, the text reading only works only if the app is in foreground (focused) only

1 Like

I am investigating the cause.

1 Like

Could you please show me your blocks? I could not reproduce the issue. I had faced the same problem, but I was somehow able to overcome the problem.

Background Tasks 3.4 A

Another exciting update is here with features and bug fixes! :grin:
There may be a few bugs in the release, if you find them, let me know :sweat_smile:

  • Periodic tasks

    • Wanted to run a task every interval? The periodic task is the choice! :upside_down_face:

      Periodic tasks will run the service with the given interval with a minimum interval which is 15 minutes (after Android oreo). This functionality cannot be used with latency. Latency should be set to zero.

      17.07.2021_15.56.50_REC


  • Boot listener

    • The extension already has the ability to start the service automatically if the phone is booted. But listening to it was not posible. This update adds functionality to start a service when the phone is rebooted or switched on.

      17.07.2021_16.04.49_REC

      If you set the Id to “777” while using the above block, the tasks will be saved and be executed when the boot is completed.


  • Multiple events

    • In the previous versions, the extension would just use the listen to the last registered event. Using multiple events on it was not possible. This is now fixed.

  • Flags feature

    • Flags are to pass any extra values or to change the behaviour of the service. There are currently three flags.

      • FOREGROUND_IMPORTANT Marks the foreground state of the service as important using the internal API.

      • IGNORE_FIRST_PERIODIC_RUN Ignores the first periodic run which gets immediately fired when the service is started. Make sure to stop the service before starting it again if you are using periodic tasks, else it may misbehave.

      • ACTIVITY_NO_KILL The flag is to stop the tasks (like the player) from being killed when the app is alive and the service is being killed.


  • Change event values

    • Now you can change the invoke values before sending it to any function if you are using the ExtraFunction block to handle events.

      For this, you will need to have a basic knowledge of Java. The same can be done to variables from now on. They will be changed when the result is true.


  • Deprecation

    • The block CreateComponentOnUi is now deprecated. All the components will be created on the UI thread from now on.

Download extension: com.kumaraswamy.tasks.aix (464.9 KB)

13 Likes

Check out the updated source on GitHub!

Made with Rush :grinning:
If rush wasn’t there, the extension for Kodular may not have existed.

5 Likes

Nice work @Xoma

1 Like

can someone help me :raising_hand_man:
i am really a newbie i learn from Youtube so i don’t know very well
i want to make a app to remind drinking water
ex 12:00am 1 pm 2 pm
how i make with this
please show be blocks

Hi,

This is possible, what have you tried?

Very nice extension.
I need help making a geo fence app
Using the cellid that the phone is connected.
Alerting the user that the phone has moved.
The background process needs to compare the current cellid to the entered cid by the user.


These are my blocks
Can’t get it to work.
Thanks

Hi TApps,

Make sure you are using the latest version.
There are some wrong things in your blocks.

You are only passing one parameter to the “show-notification” function. It should be two and not a single value.

Also, the above block is invalid, and where are you calling the extra function “process”?
Also this update uses another way of access event values.

1 Like