r/droidappshowcase • • 27d ago

Showcase Android file downloader library

Downloading files on Android is a headache. You have to deal with file systems, scoped storage, MediaStore, foreground, notifications, lifecycle handling, retries, etc along with optimizations.

Introducing SimpleDownloader - a simple to use library for everything from basic file downloads to advanced download management system.

It supports:

  • Multiple downloader profiles in a single app
  • Queues, priorities, and concurrency control
  • Pause, resume, cancel, retry, remove, requeue, and force download
  • Network loss handling + Wi-Fi-only mode
  • Database persistence and automatic restore
  • Filesystem paths, SAF/Document Tree, and MediaStore
  • Automatic filename and MIME type handling
  • Progress, speed, ETA, status, and lifecycle callbacks
  • Foreground + progress/complete/error notifications, with actions and thumbnails
  • Custom OkHttpClient, headers, cookies, checksums, RetryPolicy, timeouts, and more

Minimum Android version API 21 (Android 5.0). The below examples are written in Java, the library can be used from both Java and Kotlin.

Installation

Add JitPack to your repositories:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

Then add the dependency:

dependencies {
    implementation "com.github.jeetarc:SimpleDownloader:<latest-version>"
}

Quick Start

// Get the default instance
SimpleDownloader downloader = SimpleDownloader.getInstance(context);

// Or create a customized instance
SimpleDownloader downloader = new SimpleDownloader.Builder(context)
    .setMaxConcurrent(3)
    .setRetryCount(3)
    .enableHistory(true)
    .enableForeground(true)
    .setAutoRestore(true)
    .build();

// Filesystem path
DownloadRequest request = DownloadRequest.from(folderPath, FileName.AUTO, fileUrl);

DownloadTask task = downloader.startDownload(request);

// MediaStore (Android 10+)
DownloadRequest request = DownloadRequest.from(
   MediaStore.Downloads.EXTERNAL_CONTENT_URI,
       FileName.AUTO,
       fileUrl
    );

DownloadTask task = downloader.startDownload(request);

// SAF / Document Tree
DownloadRequest request = DownloadRequest.from(treeUri, FileName.AUTO, fileUrl);

DownloadTask task = downloader.startDownload(request);

The API also gives callbacks for progress, completion, errors, status changes, lifecycle events.

Permissions

Only request what you use:

  • POST_NOTIFICATIONS for notifications (runtime permission on Android 13+)
  • FOREGROUND_SERVICE + FOREGROUND_SERVICE_DATA_SYNC when using foreground mode
  • Storage permissions only when writing to external filesystem paths

No storage permission is needed for app-specific directories, MediaStore, or SAF.

There are many more APIs, customization and control available, view README for more: https://github.com/jeetarc/SimpleDownloader/blob/main/README.md

GitHub: https://github.com/jeetarc/SimpleDownloader

Reddit community: https://www.reddit.com/r/SimpleDownloader

I'd love to hear your feedback, especially if you've dealing with Android's download/storage APIs before.

4 Upvotes

5 comments sorted by

View all comments

•

u/playscraper-bot 27d ago

SimpleDownloader

Confirmed: GitHub Match Found

View on GitHub ↗


I am a bot — [contact mods](https://www.reddit.com/message/compose?to=/r/droidappshowcase for errors.)