Search code examples
androidloopj

Loopj. Get progress while downloading image using BinaryHttpResponseHandler


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.


Solution

  • All you have to do is override the OnProgress method :

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