Skip to content
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

Background Service is killed when app is swiped (close by user) #1783

Closed
brvier opened this issue Apr 5, 2019 · 3 comments
Closed

Background Service is killed when app is swiped (close by user) #1783

brvier opened this issue Apr 5, 2019 · 3 comments

Comments

@brvier
Copy link
Contributor

brvier commented Apr 5, 2019

Versions

  • Python: 2.7
  • OS: Android
  • Kivy: master
  • Cython: recommended
  • Pythonforandroid: master

Description

When you close a application, the service is also closed. This is an unexpected behaviors, as service should run in background, and not be killed then restarted when you kill the app.

This happen as when you remove task from task list, the method onTaskRemoved of the service is also called.

brvier added a commit to brvier/python-for-android that referenced this issue Apr 5, 2019
@brvier brvier changed the title Background Service is killed when app is swiped (c;lose by user) Background Service is killed when app is swiped (close by user) Apr 5, 2019
@AndreMiras
Copy link
Member

As far as I remember this is an Android feature. When the app is closed the service is also killed. Isn't it?
Quick googling lead me to:

@brvier
Copy link
Contributor Author

brvier commented Apr 7, 2019

No it's not a feature, it's badly coded.

Take a look at kde connect source code for example. And how the app so works. Or automate, ifttt

@AndreMiras
Copy link
Member

On KDE Connect seems to be using the START_STICKY bit. Unfortunately this is not yet working on the p4a implementation, see:

brvier added a commit to brvier/python-for-android that referenced this issue Jun 27, 2019
brvier added a commit to brvier/python-for-android that referenced this issue May 6, 2020
@brvier brvier closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants