How can I activate clock in the background when exiting the application?

Hello everyone,

I encountered an issue while trying to set up itoo. Even when I exit the application, it still activates events in the background. However, itoo is unable to call TaifunTexting1.Read or somehow trigger the clock2.times to function.
Based on the provided image, it appears that the "Alert Notice" component is activated successfully. However, it seems that there is no specific action or behavior associated with the TaifunTexting1.Read component.
I hope someone knows and can help me with this.

Thank you Taifun and Kumaraswamy for creating these excellent extensions.

1 Like

Well, you like ro use the clock in the
background... then you should register the Clock1.Timer event...your current blocks do almost nothing...also remember, there is no user interface in the background, i.e. there is no ShowAlert method available . Also what exactly do you want to do after calling TaifunTexting1 ,Read? Please elaborate...

Taifun

1 Like

My goal is to build an application that automatically reads the SMS inbox and sends this information to an email, even when the phone screen is turned off or when exiting the application.

My idea is: When exiting the application, itoo still activate clock2.times, then clock2.times will call TaifunTexting1.Read, and then send the content to an email through another utility or directly call TaifunTexting1.Read and send the information after reading it to the email.
"I have used your extension : texting."
Is this issue feasible?"

Yes, this seems doable
Taifun

Here are a few steps

  1. register the Clock1.Timer event and the TaifunTexting1.AfterReading event

  2. in the timer event handler call TaifunTexting1.Read

  3. in the after reading event handler get the inbox, write some logic to get the new message(s) and send them by email using one of the email solutions App Inventor Tutorials and Examples: Send Mail | Pura Vida Apps

Taifun

1 Like

Based on your suggestion, I have successfully completed step 3 of sending emails by connecting to SMTP. As for steps 1 and 2, if you have time, could you show me the images of the blocks connected to each other? I just learned about MIT App Inventor, so there are still many things I don't fully understand

to understand what I was suggesting for step 1 and 2 please read the first post of the itoo thread and learn from the examples from there Open Source • Background Tasks: Itoo 🚀

you should also understand the difference between an event and a method...
Unbenannt
this is not an event...
then try something and post a screenshot of your relevant blocks...

for step 3 let me suggest you to first get it running in the foreground, for example on button click... are you able to send what you want on button click?

Taifun

1 Like


resuff.aia (77.9 KB)

A very good way to learn App Inventor or Kodular is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Our Tutorials! to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun

1 Like

Thank you for your suggestions. Thanks to you, I understand more about how to operate iToo. Perhaps I should start relearning the basics from online eBooks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.