-
Notifications
You must be signed in to change notification settings - Fork 323
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
Intenet Service startForeground(notificationId, notification); #16
Comments
Fetch will continue to download the file in the background. If you intent service is killed, The instance of Fetch will no longer receive status updates via the Fetch Listener but the download will still be processing in the background. If you would like to share your code or an example, I would be glad to have a look. |
Thanks for the reply. Sorry for not being clear! when I start download and then I press the home button my app goes in the background and the download continues, but when I kill the app from background ( Keeping the home button pressed and then killing the process) the download stops. I have written a simple download program that continues downloading even if I kill the app process, but that program is not very stable and useful so I decided to use Fetch.
Also another small problem I am facing is when all downloads are stopped by any reason and I start a new download the new download goes to the queue, but Fetch starts downloading a previously enqueued one! Thanks for the help! |
@ahshoaib sorry for the late reply. When you kill an application's process, everything that runs in the process is killed(The way it suppose to work). Fetch does not run on an independent process. It runs on your applications process, so it will be killed and downloading will stop. What you are describing seems more like an application design issue. What I recommend doing is scheduling an alarm, Job Service or broadcast receiver that can start the Fetch Service in the background and continue to download requests. To do this you can simply call For your second question, Fetch is a queue based downloading service. The first request in the queue will get processed first, then the next and so on. Fetch does not currently support multi downloading. Fetch does support priority downloading. If there is a download that you want to execute immediately without waiting in the queue. you can call Request request = new Request(url,filePath);
request.setPriority(Fetch.PRIORITY_HIGH);
fetch.enqueue(request); Note that if you enqueue several request with If you would like more control of the FetchService, you can interact with it via intents and broadcast receivers. I have not documented the FetchService class yet, but it is simple enough to follow along. Hope this helps. |
Hello!
I am using fetch on the intent service. on the intent service I am calling startForeground method. The problem is when I close my app the download also stops. As I expect it should continue the download.
Thanks
The text was updated successfully, but these errors were encountered: