Loopj. Get progress while downloading image using BinaryHttpResponseHandler

3.1k views Asked by At

Thanks for such a wonderful library. Just wanted to know is there a way to get the progress or byte size downloaded while downloading big size images/files whith BinaryHttpResponseHandler. Awaiting response.

Hoping to get sample code for using this.

1

There are 1 answers

4
Hannoun Yassir On BEST ANSWER

All you have to do is override the OnProgress method :

@Override
public void onProgress(long bytesWritten, long totalSize) {
    long progressPercentage = (long)100*bytesWritten/totalSize;
}