Download / Download renewable files in Android

I was working on an Android project in which I have to upload / download multiple files via HTTP. I was wondering if there is a way to resume file upload / download. As in the case when my file is loading or downloading, and there is a thin Internet throttle for a very minimal time (sometimes it damages the file and the process stops, and the next time it starts at 0), the upload / download is paused, and as soon as the Internet is back on my device, downloading / downloading starts from the same point where it was stopped, so that the file is not damaged and the process does not start from 0.

Is there a way to achieve this functionality in android / Java? Please let me know. Thank you in advance.

+4
source share
1 answer

Html itself does not provide this ability to load a file into chunks. FileUpload is a simple object that works with the entire file and therefore sends it from scratch. To fulfill your requirements, you need more complex client / server relationships. The Java applet is a good candidate for this on the client side, and the server side is trivial. However, you need to implement some kind of protocol (for example, a handshake, start sending a file, continue from some place, check), and this is not an easy task. Even most protocols (such as ftp) do not provide such capabilities. And even when you create all this, it will only be compatible with itself. Is it really worth the effort? The general answer is no. This is the reason why we do not see such an approach in the wild.

+2
source

Source: https://habr.com/ru/post/1486802/


All Articles