Most elements of the Kolibri stack do not need to run continuously when the app is not in the foreground, so we should restrict ourselves to only keeping those things open
There is current work in progress on Python for Android to allow for integration with the Android WorkManager API, this would allow us to defer asynchronous task processing to Android, this would allow us to:
Not run our worker handler and scheduler handler at all, and defer the starting of asynchronous tasks to the WorkManager API
Start activities in response to changes in network state, such as scanning the local network for other Kolibri devices when on a local network, but otherwise not bothering
In order to achieve this, the main things we need to accomplish are:
Making the Kolibri Process Bus easier to subclass/pick and choose functionality, in order to make custom app architectures easier
Simplifying the Kolibri task API to allow simple addition of hooks to that allow it to connect to the Android API
Adding additional metadata to tasks indicating if they are expected to be 'long running'
Currently the architecture of the Android App takes can be summed up by this diagram:
It is proposed instead to shift the architecture of the app to this:
The main reasons for this are as follows:
In order to achieve this, the main things we need to accomplish are: