PRDownloader — A File Downloader Library For Android

Banner Prdownloader

PRDownloader: A file downloader library for Android with pause and resume support.

I recently published a library, which I believe to be the simplest way to handle downloading in Android with pause and resume support.

Overview of PRDownloader library:

  • This file downloader library can be used to download any type of files like image, video, pdf, apk and etc.
  • This file downloader library supports pause and resumes while downloading a file.
  • Supports large file downloads.
  • This downloader library has a simple interface to make a download request.
  • We can check if the status of downloading with the given download Id.
  • PRDownloader gives callbacks for everything like onProgress, onCancel, onStart, onError and etc while downloading a file.
  • Supports proper request canceling.
  • Many requests can be made in parallel.
  • All types of customization are possible.

How to use the PRDownloader library?

Using PRDownloader Library in your Android application

Add this in your build.gradle

compile ''

Do not forget to add internet permission in manifest if already not present:

<uses-permission android:name="android.permission.INTERNET" />

Then initialize it in onCreate() Method of application class :


Initializing it with some customization

// Enabling database for resume support even after the application is killed:
PRDownloaderConfig config = PRDownloaderConfig.newBuilder()
PRDownloader.initialize(getApplicationContext(), config);

// Setting timeout globally for the download network requests:
PRDownloaderConfig config = PRDownloaderConfig.newBuilder()
PRDownloader.initialize(getApplicationContext(), config); 

Make a download request:

int downloadId =, dirPath, fileName)
                        .setOnStartOrResumeListener(new OnStartOrResumeListener() {
                            public void onStartOrResume() {
                        .setOnPauseListener(new OnPauseListener() {
                            public void onPause() {
                        .setOnCancelListener(new OnCancelListener() {
                            public void onCancel() {
                        .setOnProgressListener(new OnProgressListener() {
                            public void onProgress(Progress progress) {
                        .start(new OnDownloadListener() {
                            public void onDownloadComplete() {

                            public void onError(Error error) {

Pause a download request


Resume a download request


Cancel a download request

// Cancel with the download id
// The tag can be set to any request and then can be used to cancel the request
// Cancel all the requests

Status of a download request

Status status = PRDownloader.getStatus(downloadId);

Clean up resumed files if database enabled

// Method to clean up temporary resumed files which is older than the given day

More examples and the PRDownloader Library Github Project are available here.

Happy Downloading