How to to run a function in background even after the app is closed?

@vknow360 Ok, I got a message from Evan Patton (MIT team) in the AI2 power user forum:

Assuming that Kodular is keeping up with MIT’s master, a somewhat recent pull request added the ability for extensions to declare service elements in the AndroidManifest. I actually built a similar extension to test that PR by just having a background clock going in an extension to drive UI updates even when the screen was off. This functionality is part of the upcoming nb184 release (You can check out master and use the extensions in ai2-test).

@Hossein might be able to speak more to where Kodular stands w.r.t. support for services in extensions.

Edit: Here is the PR in question:

github.com/mit-cml/appinventor-sources

4 Likes