I know how to make a simple downloader for Android
. The trick is simple, you make a connection, start getting data and you place the data in the file the same way you receive it and thus you end up downloading the file.
But what if I want to add pause
& resume
functionality?
Ok, I can understand how many bytes have been written by getting the length of the file and comparing it with the content length from the HttpURLConnection
and start writing the byte next to it.
How do I tell the server to send me the bytes that I need rather than sending the bytes from the start ?
Note: I am not looking for pre-existing libraries to assist with this question.