I am using android.app.DownloadManager to download large files - (about 700mb), on android tv - 7.1.1. So when server is giving me files with speed 1mb/s everything is fine. But when speed is 500kb/s I cannot download file. Almost half of file is loaded with status Running, after that DownloadManager giving status FAILED with reason ERROR_CANNOT_RESUME.
I was looking inside source code and found that android.provider.Downloads has STATUS_CANNOT_RESUME that is from 489 error code.
And no much information about what exactly happened. So provide me some suggestions If you reached same problem.
1 more time - the app is working fine if speed connection is fast.
Strange that it seems to be speed related, never seen / experienced that before.
Do you manage the webserver yourself?
If so, ensure that the server sends a "Etag" with the header.
Etag-info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
I currently work on a webserver from scratch and I have tested different header scenarios with downloadmanager. It seems to throw STATUS_CANNOT_RESUME when reaching 99% and ETag is not present.
My Etag generator is a SHA1 of the file downloaded, and that seems fine for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With