Open Source • Background Tasks: Itoo 🚀

Hi All,
I can't find an example of using the itoo.CreateTask block? I'm aiming for a background service that monitors the Clipboard and temporarily stores changed clipboard values to an itoo.StoreProperty entry. In trying out my app (see example blocks), I get the following error:-

I assume I'm missing an itoo block to associate the CreateTask block with,
but can't figure out which it is...

All help gratefully received.
C.

A task runs only a very short amount of time. Create a process instead

Foreground Service: A user visible and recommended way to execute something in the background.

  • Itoo is primarily based on supporting this service.

You will have to build the project to test. It will not run in the companion app.

As already mentioned earlier, first get it running in the foreground while the app is running

Taifun

Thanks for the warning, Taifun.
What I'm after is a service that will continue running even when my app is not the current/visible (ie. background) app or when my app stops running. Would an itoo.createProcess - described as 'foreground service' in the documentation? - be able to provide such a background service?
Thanks,
C.

1 Like

Yes, go ahead and use the Create Process block. Also iToo does not work in the companion; build your APK instead.

1 Like

Hi, can anyone see a reason why my itoo.RegisterEvent block might fail to activate the process when the clipboard1.ClipboardContentChanged event is triggered?
The greyed out blocks - disabled for build - work fine when enabled, so I must be doing something wrong in the itoo blocks - just can't see what :neutral_face:

Any help gratefully received.
C

Hello @chrisRoald, your blocks are almost correct.

Please add an x argument to your procedure CB_Monitor. It is a standard iToo convention.

Thanks, that works now - almost correctly :exclamation:

Just one problem; when a new value arrives in the clipboard, the clipboard1.ClipboardContentChanged event registered in my CB_Monitor procedure seems to be triggering twice :thinking: - the recordClipboardValue procedure certainly adds two key:value pairs to the storedProperty; so am assuming it is called twice...

Can you see anything obviously wrong.
Thanks,
C.

Can you please confirm this is not a behaviour originating from the Clipboard manager extension? Use the Clipboard manager normally without Itoo and see how it behaves.

If it's not the Clipboard manager, I might suspect Itoo is running two of the same processes. (Which it shouldn't! The newer versions of Itoo have fully fixed this faulty behaviour.)

I advise you to use the StopProcess block before calling Itoo's CreateProcess block.

Hi Kumaraswamy, you're quite right - extension joeDevClearClipboard is the duplicating culprit :hushed:
I'll have to find a way of suppressing the duplicated event trigger (either at the clipboardManager or Itoo process end), or maybe more easily - comparing contiguous clipboard values for equality.
Thanks for the clue.
C.

1 Like

i want store value mysql every 1 minute, but dont know how to setup itoo, help me, i use deephost mysql extention pro for mysql

Show us what you have tried so far.

I want store data to mysql notice teble every 5 minutes, can it possible use itoo? Like cron job system, i want run my php every 5 minutes

Yes you can
See the answer above

See example 6 here, thank you @TIMAI2

Please try something yourself. Start simple and add more logic after xou got something working.
If you got stuck, show us a screenshot of your relevant blocks

Btw. for mysql there is no need for an extension, you can do it using the web component directly

Taifun

1 Like

Hi Taifun and Kumaraswamy

Before I embark on this idea for an app (which will definitely not be available for Play Store!), could I just check a few things?

The basic premise of the app:

  • runs in the background (foreground ?)
  • gets device location
  • receives sms and sends sms (from trusted phone numbers)

How it would work:

  • a trusted device / phone number (no app required on the trusted phone/s, although there could be) would send an sms with a specific command (e.g. "fmp_location") to the lost phone running the app.
  • the lost phone receives the sms
  • the lost phone reads the message, checks from a trusted number.
  • if message is "fmp_location" then the lost phone gets its location using GPS (only)
  • the lost phone sends an sms with its location to the trusted sender
  • lost phone is no longer lost !!

Is this possible ?

Thanks

To be able to do this in the background you need background location permission. My locationservice extension can do it App Inventor Extensions: Location Service | Pura Vida Apps

In the background the texting component can only display a notification. My sms receiver extension can do background processing using itoo App Inventor Extensions: SMS Receiver | Pura Vida Apps

Yes

Taifun

OK, many thanks, will have a look at this and see how I get on.

I have already found an app that offers the same and more functionality on FDroid, but thought it would be good to create an Appinventor version.

1 Like

i want use [FREE] SMS Reader Extension - Extensions - Kodular Community this extension, ans want store my sms in mysql server, i want make getway type system , can you help me and give me demo aia , when itoo run its call sms reader, and store all sms mysql server,

That extension works only in the foreground
I can offer my sms receiver extension App Inventor Extensions: SMS Receiver | Pura Vida Apps to receive sms in the background and start some processing using itoo

Note: this type of app will not be approved by Google Play

Taifun

I know this type app not published play strore, but i want make app payment getway type,
Can you help me for making payment getway app

Yes I can. For details I just sent a PM.
Taifun