Background foreground

I have read a few posts regarding background and foreground and am a little confused, I got the impression from one post that AI programs could not run in the background and then there was another post that indicated there was an extention for running background tasks.

Program1
I have one AI program that each second checks the bluetooth client and if there is a new bluetooth message from an Arduino board and HC-05 it sends that message as a SMS (Entrance Breach). This works whether the program has focus or the main screen or not (background ??) and also while the phone screen is off.


So program1 runs whether it is in the foreground or the background.

Program2
I have a second program running on a second phone that uses the texting object to read the messages and notify the user of the arrival of a message. This works fine in foreground, but does not work when in the background. I added a clock to this program and a beep to the clock, when the program is in the background the beep is still evident, so the app is still running but the access to the texting object is I guess blocked.
image

image

Question

Is there some way that I can make the program action the When Texting1 block each clock tick???

Suggest you have a good read of this topic, try something, ask questions...

You might also consider this:
https://ullisroboterseite.de/android-AI2-KeepAlive-en.html
https://ullisroboterseite.de/android-AI2-WakeLock-en.html

2 Likes