Home

Awesome

ThinDownloadManager

Thin DownloadManager is an android library primary to download files and to avoid using DOWNLOAD_WITHOUT_NOTIFICATION permission when using Android provided DownloadManager in your application.

Why ?

There are few reasons why you might want to use this library.

Most of the times we download using Android's DownloadManager to external files directory and upon successful completion move the downloaded file to the sandboxed application's cache/file directory to avoid writing a own download manager which is a bit tedious. This library is handy in such situations.

Usuage

DownloadStatusListener (Deprecated)

    //Callback when download is successfully completed
    void onDownloadComplete (int id);

    //Callback if download is failed. Corresponding error code and
    //error messages are provided
    void onDownloadFailed (int id, int errorCode, String errorMessage);

    //Callback provides download progress
    void onProgress (int id, long totalBytes, long downlaodedBytes, int progress);

DownloadStatusListenerV1

    //Callback when download is successfully completed
    void onDownloadComplete(DownloadRequest downloadRequest);

    //Callback if download is failed. Corresponding error code and
    //error messages are provided
    void onDownloadFailed(DownloadRequest downloadRequest, int errorCode, String errorMessage);


    //Callback provides download progress
    void onProgress(DownloadRequest downloadRequest, long totalBytes, long downloadedBytes, int progress);

DownloadRequest

ThinDownloadManager

No Permissions Required

Setup

Include below line your build.gradle:

dependencies {
    compile 'com.mani:ThinDownloadManager:1.4.0'
}

Make sure you included jcenter() in your repositories section.

Download

<a href="https://play.google.com/store/apps/details?id=com.mani.thindownloadmanager.app&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"><img alt="Get it on Google Play" width="100" height="50" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" ></a>

Android Arsenal

Credits

https://android.googlesource.com/platform/packages/providers/DownloadProvider/

NOTE: Android's DownloadManager has plenty of features which is not available in ThinDownloadManager. For ex. pause and continue download when network connectivity changes.So analyse your requirement thoroughly and decide which one to use.

https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/ Steps for uploading to bintray.

License

 Copyright 2013 Mani Selvaraj

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.