P
P
powato2016-10-17 12:27:02
Java
powato, 2016-10-17 12:27:02

What are the solutions for downloading files on Android?

I want to download files according to the list of URLs, showing the loader, and according to the result, report that so many files with such and such names have been uploaded.
Question: Does anyone have code or library examples that would help solve this issue? Those. during the launch of the application, a Splash activity opens, on which a loader is shown, such as loading data, and then, when it loads, you need to write that everything is OK, the data was received in such and such an amount.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Peter, 2016-10-17
@petermzg

1. Transfer http interaction to service
2. There DefaultHttpClient + in the request add the Range header , this will allow you to receive the file in pieces (if the server supports resuming)

Z
Zhenya Kizirov, 2016-10-27
@LittleBrains

For example, either https://github.com/koush/ion

Ion.with(context)
.load("http://example.com/really-big-file.zip")
.write(new File("/sdcard/really-big-file.zip"))
.setCallback(new FutureCallback<File>() {
   @Override
    public void onCompleted(Exception e, File file) {
        // download done...
        // do stuff with the File or error
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question