Open Source • Background Tasks: Itoo 🚀

Ok, I read the whole thread but I could not find anything helpful for my case.
It seems that I have wait for Kumaraswamy. Maybe he can help.

as he already said in that link I provided earlier

I've been trying multiple ways to get it working, apparently no solution has been found yet. Im also not sure if it is possible to run the texting component natively.

Taifun

So it's not possible to check for sms in the background ?

directly probably not
but indirectly probably yes, if you combine both extensions itoo and my texting extension to find out, if a new sms has been arrived in the inbox
you will have to do some experiments...
let us know about your progress...

Taifun

I need help with my program. I need to make an app that dims the screen based on the orientation on the phone. It needs to be able to do this in the foreground

I have tried to get it to read the orientation every half a second, but it always tells that the app keeps stoppping.

as a start

in your case the procedure programStart

also procedure changeBrightness needs exactly the same arguments as the OrientationSensor.OrientationChanged event, i.e. azimuth, pitch and roll and you must use that argument pitch rather than orientation.Pitch
also I think, the eventName must be OrientationSensor1.OrientationChanged rather than only orientation.OrientationChanged
I do not know, if additionally something needs to be done for the BrightnessTools extension... @Kumaraswamy might want to advice...

Taifun

1 Like

Also make sure to pre-enable the "change settings permission" as the extension cannot ask it while in background, and the register event can only be called in the background.

I have already asked to change permissions. Also what should I do with the little x? I added it, but what do I use it for?

I changed the sensor name to orientation.


I changed it up how you said and I don't know what I did wrong. Do you see anything I am missing?

I would not rename the components/events...
Taifun

gotcha

Done, here is what it looks like now.

For me the blocks look fine

If you do not get anything, try to send a notification in method changeBrightness, see several examples how to do it in this thread

Also check logcat

Taifun

Just one more thing, add this block at the start of the programStart procedure, since it is not possible to directly register an event without touching the component.

1 Like

In my, Create with trigger is missing @Kumaraswamy

Yes, you are right, I had to remove the CreateTrigger block, you should find other ways to replace that block.

@Jo_g12 Let us know if that has worked for you.

That was the fix thanks a bunch

1 Like

Does the extension compatible with Location Service by Taifun?

I have such test app:

Buttons works fine. But, after move app to the background there are error message appeared ("Error in the app, Close the app").
This does not depends where I'm starting the background process - on Screen initialize or by another event. Also does not depends - am I using Notifier or Notification extension. Process does not start or Error in the application.

In the Kodular both extensions works (looks like). But in my Kodular's app Taifun's extension doesn't write a data in the TinyDB, so I'm not sure if it works as needed.