CBIC Background Runner
A free extension for MIT App Inventor and Niotron. It runs your own procedures while the app is closed: later, every 15 minutes or more, at a set time, after the phone starts, or as a foreground task with a notification.
Free for any app, also apps you sell. Closed source. No network connection, no tracking.
Downloads
- SHA-256 6ffbdc3b80de6b5d83279e51f869becbab3c9878a6ae3f43736799816604cf60
- SHA-256 66a0de3c396c14b4af22ee9f838a70ce5a6b53aacd2d8f3e00f82abd4df57df6
- SHA-256 00cbae78e505875f8d13f23b57d2086ff12506438bfb4238b3e69da5d701ce7a
- SHA-256 8d0119fd7bbfdb1c22c431b38a34dcc37323e070d5ab80f27e394acc66fe1159
- SHA-256 c3a7d7508ba52a3d738dfdb9a2cd9bc768f7dbe811a935770e32ec79d27733f3
- SHA-256 e43dcc9657955fb6c98a661bfa459e1985370ac288beb769b5891284d8bf97c4
Check a file: sha256sum FILE (Linux), shasum -a 256 FILE (macOS), certutil -hashfile FILE SHA256 (Windows). The result must match the hash above.
Six rules
- Give the procedure name as text (for example
"syncNow") and its arguments as a list. For a procedure with no inputs, use "create empty list". - Every job has a name. A block with the same name replaces that job. Cancel, JobState and LastResult take the name.
- A background run has no screen. The procedure can use TinyDB, Web, File, Clock and similar components, and ShowNotification. It cannot use buttons, labels or other screen components. If it tries, the run fails with a clear error and the app does not crash.
- Build the app. Background jobs need a built app (APK or AAB). In the Companion each block gives a clear error.
- A job or alarm run can take up to 9 minutes, events such as Web.GotText included.
- JobFinished, JobFailed and ForegroundStopped reach the app only while it is open. For runs while the app was closed, read LastResult and JobState.
Blocks
| Block | What it does |
|---|---|
| RunProcedureLater | Runs the procedure once, at least delayMinutes from now. Optional: only with a network. |
| RunProcedureEvery | Runs the procedure every intervalMinutes (15 or more). Android can move runs to save battery. |
| RunProcedureAt | Runs the procedure at a time (milliseconds or a Clock instant). repeatMinutes 0 = once, 1440 = every day. |
| RunProcedureAtStartup | Runs the procedure each time the phone has started. |
| StartForeground, StartShortTask | Start a task with a notification and a Stop button (types dataSync and shortService). Call them while the app is open. |
| UpdateForeground, StopForeground | Change the notification text, or stop the task. |
| Cancel, CancelAll, Jobs | Cancel one job or all jobs, or list the jobs. |
| JobState, LastResult, LastRunTime | Scheduled, Running, Succeeded, Failed or Cancelled; the returned value or the error; the last run time. |
| AlarmTiming, CanScheduleExactAlarms, OpenExactAlarmSettings | Show if an alarm is exact, and open the "Alarms & reminders" page. |
| ShowNotification, CancelNotification | Show or remove a notification, also in background runs. |
| InBackground, ForegroundTaskName | True inside a background run; the task that runs now. |
| ExactAlarms (designer) | Turn on only if the app needs the exact minute. Adds the exact-alarm permission. |
| JobFinished, JobFailed, ForegroundStopped | Events in the open app. |
Android behaviour you must know
- Exact alarms: on Android 14 and newer the user must allow "Alarms & reminders". Until then Android can run an alarm some minutes late.
- Force-stop: Android removes the jobs and alarms of a force-stopped app. Some phones force-stop an app when you swipe it away. The extension sets everything up again when the app opens; jobs whose time has passed run then.
- Foreground tasks: Android 15 and newer allow dataSync 6 hours a day. A short task ends after about 3 minutes.
- Phone makers: battery savers on Xiaomi, Oppo, Vivo, Samsung and other phones can delay or stop background work. The extension cannot change these settings. Ask your users to allow background activity for your app if it depends on it.
Google Play
- Play requires target API 36 for new apps and updates.
- StartForeground: fill the foreground-service declaration in Play Console (App content), with a video of the user starting the task.
- Exact alarms: the extension uses SCHEDULE_EXACT_ALARM. Do not add USE_EXACT_ALARM unless your app is an alarm, timer or calendar app.
- Data safety: the extension sends no data. Declare what your own procedures send.
Permissions
Only the permissions of the blocks you use go into your app.
| Permission | Added when |
|---|---|
| RECEIVE_BOOT_COMPLETED | always |
| ACCESS_NETWORK_STATE | RunProcedureLater, RunProcedureEvery |
| SCHEDULE_EXACT_ALARM | ExactAlarms on |
| FOREGROUND_SERVICE, WAKE_LOCK | StartForeground, StartShortTask |
| FOREGROUND_SERVICE_DATA_SYNC | StartForeground |
| POST_NOTIFICATIONS | StartForeground, StartShortTask, ShowNotification |
Tested
Tests of the 1.0.0 build (18 November 2026): the sample app built with the MIT App Inventor build server, on Android emulators.
| Android | Result |
|---|---|
| 14 (API 34) | Pass: app swiped away, one-time, chained, periodic and alarm jobs (also in Doze), foreground task, Stop button, short-task time limit, reboot. 0 crashes. |
| 15 (API 35) | Pass: app swiped away, jobs, alarm, foreground task, reboot. 0 crashes. |
| 16 (API 36) | Pass: same steps as Android 15. 0 crashes. |
The 1.0 tester build, with the same engine, also passed on Android 12, 15 and 16 (MIT App Inventor build: force-stop, app update, battery saver, exact-alarm and notification permission changes) and on Android 15 and 16 (Niotron build).
Kodular and Android Builder: tested successfully by the Casagbic team.
Not tested: real phones (phone-maker battery savers are not covered), and Android 5 to 11.
Privacy and licence
The extension makes no network connection and collects nothing. It keeps each job's name, arguments, state and last result in your app's private storage on the phone. Details: privacy note.
Free for any app, including apps you sell, with no credit needed. You may share .aia projects that contain the extension. Do not decompile it or offer the .aix on other sites; link to this page. Full terms: licence (EULA).
Changes
1.0.0 (18 November 2026): first public release. Full changelog.
Help
Ask in the extension topic on your builder's community forum, or write to [email protected]. Send the builder and its version, the extension version, the phone model, the Android version, an image of your blocks, and a logcat filtered by CBICBackgroundRunner.