8000 Support for Worker/WorkManager · Issue #2021 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content
Support for Worker/WorkManager #2021
Open
@tito

Description

@tito

Services in Android start to being agressively stopped with doze mode and Android 10. So if you want to execute something into the background, there is many solution, but the most state of the art is to use Worker/WorkManager . (another approach would be AlarmManager)

It requires androidx (#2020)

The first step is to add the dependencies in the build.gradle:

dependencies {
    implementation 'androidx.work:work-runtime:2.2.0'
    implementation 'androidx.annotation:annotation:1.1.0'
}

Now, if you want to execute Python in a Worker, we have the same issue to start Python from Java as Service.
The plan would be to create a PythonRunner java class with a native entrypoint implemented in C to start Python, then update our PythonService to use it, and we can also provide a PythonWorker as well that use it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0