-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Download file in foreground service #31
Comments
In fact I know little about Android's background management. OEMs are usually likely to override this part of Android OS as well. Behaviors become more unpredictable due to several reasons. |
This is what can happen when putting Seal in background in background in my Pixel 4XL (latest Android 12 update, no battery restriction)
Will this be fixed putting the download in a background service? I think so but I am not sure. |
I see. Could we just start a foreground service which only display a "Downloading" message without doing anything, and prevent Seal get killed at the same time? I feel pain dealing with interaction between UI and service. |
I don't know if this can help but I don't think so. However I can try. This weekend I will make some tests and think a way to minimize the service / UI interaction work. |
Yes that would work, but that would not be suggested.
Well yeah the Intent handling part is really really bad, the code for all A different way that I personally like is that you can keep a service running as soon as user clickes Download, service "observes"/"collects" from a flow and if the flow is empty it will show empty notification and as the flow keeps stacking you can show the |
We discussed this in #38 before. Currently, I'm using the workaround I've mentioned here and the background downloading works well. |
Even with battery optimization disable, Android still kills the download process in the background, try removing the app from recent apps the download will stop. Tested on android 10 |
Removing the app from recent apps means killing the app by force. I think the current workaround works well with long-time downloading and also provides the flexibility for not modifying many existing codes |
Yes, I know that, but this also happens when converting to mp3 especially for long clips, but when using work manager I don't think such problems will happen. |
Hey, @JunkFood02 Nice app 👍 |
Hi
Are you thinking about placing download task in a foreground service so that it is more unlikely to be killed by android OS? If you like the idea and you are not already working on it, I can work to do it. I am thinking about placing the download task in a foreground service, so that, if the app is killed, the downloads continues. If the app is manually restarted after being killed while the service is still alive, the app connects to the service and shows the download progress.
What do you think?
The text was updated successfully, but these errors were encountered: