How can I keep sending SMS to specific time, even when device is in standby-mode?

Hey guys!
I am new to programming, especially with the MIT App Inventor. I am currently trying to get my first script to run like this: Take current time, round up to next 15 minutes (only in first cycle), add 30 Minutes to it, and at this specific time, an SMS should be sent. I am doing this with a simple clock. My problem is now, that the SMS doesn't fire, when the device is in standby-mode (screen off, Always On Display still visible). Although, the SMS seems to get sent after I turn the screen back on. So it kind of gets put in queue or something like that. Two screenshots of script following:


After a bit of research, I came to the conclusion that my plan cannot be realised, due to the software being able to work only when not in standby. But is it really like that? Isn't there a way (maybe with extensions) to get this work properly?

Maybe some of you guys can help me! :slight_smile:
Thank you in Advance!!

You could use the alarmmanager extension to start your app at the given time above the lockscreen, send the sms and close the app automatically again

Taifun

Hey Taifun!
Thank you for the quick answer! :slight_smile:
Nevertheless, I do not try to open the app at a specific time, but to send an SMS automatically without the user having to do something. The app should be running the whole time. The device shouldn't even turn the screen on for sending. Is this possible with this extension?

Thanks,
RafVuc

In my tests I was not able to send an sms while the app is in the background, i.e.is not running

This is possible with the alarmmanager extension as mentioned earlier

Taifun

Hello @RafVuc, if you are interested, you can sponsor such a custom extension. I would be able to help you with that.

For a simple solution just keep the screen on using the KeepScreenOn method from the tools extension

To reduce battery consumption you additionally could reduce the screen brightness using the settings extension

Taifun

Hey @Kumaraswamy! Thank you for your offer!! But I am afraid to tell you (and @Taifun) that I am not willing to pay for any extensions. Are there any free alternatives? Keeping the screen on isn't really an option for me.
Thank you for your responses guys!!
RafVuc

You could write your own extension and create the functionality yourself... then provide it for free to the community and additionally provide support in case people have questions...

more information about how to create an extension see the App Inventor Extensions document
however that will be more advanced and will require some Java skills...

Taifun

PS: see also this comment (by @Italo)

You can start learning all you need to learn to do it, then do it, after long days of trying things, testing and failing, all in your spare time, leaving other things you like to do for this.
Then after all that time and intellect invested, just give it out for free so everyone can make money with it except you.
Sounds awesome right? :thinking:

Not possible to send an sms in the background. It might be possible to send the text in the Foreground.

I am aware of two possibilities:

This extension might be able to send an sms when your screen shuts down in the foreground. I built Foreground apps to use with the Pedometer and Texting using Uliss' previous version of the extension. That extension is now deprecated. I have not yet attempted to make a version using his new version of the extension.

https://ullisroboterseite-de.translate.goog/android-AI2-KeepAwake.html?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=de#down

and

It might be possible using the Foreground capabilities of Itoo

Thank you all for your quick help. Will try those things recommended. Maybe invest in a paid extension. We will see...
RafVuc