Skip to content

Continue download even after app is closed in Android?? #267

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

Open
cg-manish opened this issue Mar 17, 2020 · 6 comments
Open

Continue download even after app is closed in Android?? #267

cg-manish opened this issue Mar 17, 2020 · 6 comments

Comments

@cg-manish
Copy link

cg-manish commented Mar 17, 2020

Currently if the app is closed download also stops which is not very helpful while downloading large files.

@hnvn
Copy link
Member

hnvn commented Mar 17, 2020

What's the meaning of "be closed" in this use case? If you mean that users press back button to quit the application, the plugin will support your download tasks still running in background. But if users kill your application (such as closing it from recent apps UI) or even in case of being killed by OS deal with the lack of memory problem, all tasks will be stopped. I think it's valid use case because when users intend to close your application in this way, it means that users don't want your application running anymore.

@cg-manish
Copy link
Author

What's the meaning of "be closed" in this use case? If you mean that users press back button to quit the application, the plugin will support your download tasks still running in background. But if users kill your application (such as closing it from recent apps UI) or even in case of being killed by OS deal with the lack of memory problem, all tasks will be stopped. I think it's valid use case because when users intend to close your application in this way, it means that users don't want your application running anymore.

Yes , I meant user closing from recent apps UI. I asked for this because of request from users who wanted things downloading even after the app is killed. I found that in android DownloadManager can perform this, just wanted to know your thoughts about this.

@hnvn
Copy link
Member

hnvn commented Mar 17, 2020

I am afraid that I can't find spare time to support it this time

@781flyingdutchman
Copy link
Contributor

What surpriso1997 wants would require a rewrite of the plugin to use the DownloadManager instead of the WorkManager that is used right now, and that's a major rewrite. The use case you're describing is an edge case, as a user can reasonably expect all app-related activity to end if they explicitly kill the app.

@SaadArdati
Copy link

SaadArdati commented Aug 13, 2020

What's the meaning of "be closed" in this use case? If you mean that users press back button to quit the application, the plugin will support your download tasks still running in background. But if users kill your application (such as closing it from recent apps UI) or even in case of being killed by OS deal with the lack of memory problem, all tasks will be stopped. I think it's valid use case because when users intend to close your application in this way, it means that users don't want your application running anymore.

@hnvn @781flyingdutchman

This should 100% be optional for us to decide. Many apps do downloads even after killed.
Whatsapp backups, Youtube recommendations refresh, Google drive downloads, every single download manager app...

When I used this package, this was my expectation for it. There is no mention of this anywhere.

@mr-mmmmore
Copy link

I too though that this would be the default behavior.

When the app is killed by the user, I agree that it could be seen as the user wanting that any app-related activity is ended. But even this may depend on the nature of the app and leaving this decision to the app's developer would be great.

But when the system kills the app and there are running downloads, it's obviously contrary to the user's will: he leaved the app expecting that the downloads would be completed when he comes back. Ideally the background downloads shouldn't stop in this case.

I have one question: at the moment can we be sure that anytime a task update event comes from the plugin the app will be running and receive this event? I had assumed that this wouldn't be the case but the information you provided @hnvn make me think that maybe I was wrong. For example if the user leaves the app (but doesn't kill it), will the app still receive the plugin's updates?

What I am trying to evaluate is the possibility for the download state maintained in the app to become out of sync with the plugin's database if some of the events are missed. I was trying to find a solution to get around this as explained in #402, but this desynchronization may never happen... ?

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

5 participants