-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Worker/WorkManager #2021
Comments
Hello, |
Even though this is a 2019 issue, it's still much relevant. |
WorkManager support is already implemented here -> #2464 I need to find some time to polish the PR |
I see the PR has not been updated for 9 months, is this still in progress? I am very interested in this to better handle long running tasks in our Android App. We currently have a pure Python task runner, and it would be useful to be able to swap in a WorkManager compatible interface instead. |
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
: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.
The text was updated successfully, but these errors were encountered: