🌐
GitHub
github.com › Justson › Downloader
GitHub - Justson/Downloader: A cost-effective Android file downloader · GitHub
allprojects { repositories { ... maven { url 'https://jitpack.io' } } } Support · implementation 'com.github.Justson:Downloader:v5.0.4' Androidx · implementation 'com.github.Justson:Downloader:v5.0.4-androidx' File file = DownloadImpl.getInstance(getApplicationContext()) .url("http://shouji.360tpcdn.com/170918/93d1695d87df5a0c0002058afc0361f1/com.ss.android.article.news_636.apk") .get(); DownloadImpl.getInstance(getApplicationContext()) .url("http://shouji.360tpcdn.com/170918/f7aa8587561e4031553316ada312ab38/com.tencent.qqlive_13049.apk") .enqueue(); DownloadImpl.getInstance(getApplicationCo
Starred by 431 users
Forked by 87 users
Languages   Java
🌐
Pointradio
pointradio.net › merhvt › how-to-download-file-from-url-in-android-programmatically-github.html
Pointradio
You can also write a… User agents should provide the ability to save a local file programmatically given an amount of data and a file name. Sample Download. After selecting that option, you can type the URL of the repository, press "Clone", and select a folder. Mar 02, 2019 · Upload file ...
🌐
GitHub
gist.github.com › milon87 › 72c354984ae52727e90b4297b553b17b
Download file android · GitHub
Clone via HTTPS Clone using the web URL. ... Clone this repository at <script src="https://gist.github.com/milon87/72c354984ae52727e90b4297b553b17b.js"></script> Save milon87/72c354984ae52727e90b4297b553b17b to your computer ...
🌐
GitHub
github.com › naumanmir › filedownloadservice
GitHub - naumanmir/filedownloadservice: A kotlin based Android library which downloads files in background using android service and notifications. Provide url of the file to download, folder path where you want to download and filename. · GitHub
First create a folder where you want your file to be downloaded and also create a file name for the file to download. val folder = File(Environment.getExternalStorageDirectory().toString() + "/" + "HelloWorld") if (!folder.exists()) { ...
Starred by 19 users
Forked by 5 users
Languages   Kotlin 96.2% | Java 3.8%
🌐
Stack Overflow
stackoverflow.com › questions › 50897130 › how-to-programatically-download-an-apk-from-github
android - How to programatically download an apk from github? - Stack Overflow
"+progress[0]+"%"; } bar.setMessage(msg); } @Override protected void onPostExecute(Boolean result) { // TODO Auto-generated method stub super.onPostExecute(result); bar.dismiss(); if(result){ Toast.makeText(getApplicationContext(),"Download Succesfull!", Toast.LENGTH_LONG).show(); }else{ Toast.makeText(getApplicationContext(),"Error: Try Again", Toast.LENGTH_SHORT).show(); } } @Override protected Boolean doInBackground(String... arg0) { Boolean flag = false; try { URL url = new URL("https://raw.github.com/user/repository/branch/filename"); HttpURLConnection c = (HttpURLConnection) url.openConn
🌐
GitHub
github.com › tonyofrancis › Fetch
GitHub - tonyofrancis/Fetch: The best file downloader library for Android · GitHub
Fetch is a simple, powerful, customizable file download manager library for Android.
Starred by 1.8K users
Forked by 358 users
Languages   Kotlin 85.3% | Java 14.6% | Shell 0.1%
🌐
GitHub
github.com › lingochamp › FileDownloader
GitHub - lingochamp/FileDownloader: Multitask、MultiThread(MultiConnection)、Breakpoint-resume、High-concurrency、Simple to use、Single/NotSingle-process
Just create your own DownloadMgrInitialParams.InitCustomMaker and put those customized component to it, finally init the FileDownloader with it: FileDownloader#init · The restriction of background service has been tightened since Android 8.0, for more details, please refer to here.
Starred by 11.1K users
Forked by 2.2K users
Languages   Java
Find elsewhere
🌐
GitHub
github.com › wlfcolin › file-downloader
GitHub - wlfcolin/file-downloader: FileDownloader, powerful http/https file download tool on Android · GitHub
FileDownloader.detect(url, new OnDetectBigUrlFileListener() { @Override public void onDetectNewDownloadFile(String url, String fileName, String saveDir, long fileSize) { // here to change to custom fileName, saveDir if needed FileDownloader.createAndStart(url, newFileDir, newFileName); } @Override public void onDetectUrlFileExist(String url) { // continue to download FileDownloader.start(url); } @Override public void onDetectUrlFileFailed(String url, DetectBigUrlFileFailReason failReason) { // error occur, see failReason for details } });
Starred by 387 users
Forked by 148 users
Languages   Java
🌐
GitHub
github.com › mattbdean › Kdown
GitHub - mattbdean/Kdown: Downloading files programmatically made easy · GitHub
Kdown provides a simple but powerful interface to download files both synchronously and asynchronously. val kdown = Kdown() val url = "https://i.imgur.com/Yf2kWzd.png" val directory = File("my-download-dir") // Download the file, not caring ...
Author   mattbdean
🌐
GeeksforGeeks
geeksforgeeks.org › android › how-to-download-file-from-url-in-android-programmatically-using-download-manager
How to Download File from URL in Android Programmatically using Download Manager? - GeeksforGeeks
July 23, 2025 - Here we will be simply adding the link of the file available online. When we click on the Button it will be downloaded automatically to our phone storage. This is a very frequently used feature as we can use this feature to automatically download ...
🌐
GitHub
github.com › r-oung › android-download-manager
GitHub - r-oung/android-download-manager: Android download manager example · GitHub
This sample app shows how to download a file from a remote URL using Android's DownloadManager.
Author   r-oung
🌐
GitHub
github.com › coolerfall › Android-HttpDownloadManager
GitHub - coolerfall/Android-HttpDownloadManager: An useful and effective http/https download manager for Android, support breakpoint downloading.
An useful and effective http/https download manager for Android, support breakpoint downloading. - coolerfall/Android-HttpDownloadManager
Starred by 209 users
Forked by 42 users
Languages   Kotlin 100.0% | Kotlin 100.0%
🌐
GitHub
gist.github.com › PasanBhanu › 46f08845ee3b7acf93de81acf8048fa2
Download Image from URL and Added to Gallery - Android (Java) · GitHub
Clone via HTTPS Clone using the web URL. ... Clone this repository at <script src="https://gist.github.com/PasanBhanu/46f08845ee3b7acf93de81acf8048fa2.js"></script> Save PasanBhanu/46f08845ee3b7acf93de81acf8048fa2 to your ...
🌐
GitHub
github.com › ssseasonnn › RxDownload
GitHub - ssseasonnn/RxDownload: A multi-threaded download tool written with RxJava and Kotlin
disposable = url.download() .observeOn(AndroidSchedulers.mainThread()) .subscribeBy( onNext = { progress -> //download progress button.text = "${progress.downloadSizeStr()}/${progress.totalSizeStr()}" button.setProgress(progress) }, onComplete = { //download complete button.text = "Open" }, onError = { //download failed button.text = "Retry" } )
Starred by 4.1K users
Forked by 613 users
Languages   Kotlin 86.8% | Java 13.2% | Kotlin 86.8% | Java 13.2%
🌐
Iiasfutured
symphonyhospitality.iiasfutured.com › pkg-rap-y5nxl › download-file-from-url-android-github.html
Download file from url android github
Apr 17, 2016 · How to programmatically only run Mp3 files online inside android app on button click. g. The latest release includes support for JavaMail on Android. get(). Commit the file. Drop file here (or multiple files) to load content or click on this box to open file dialog. json” button to download this file. More examples and the PRDownloader Library Github Project are available here.
🌐
GitHub
github.com › kk121 › File-Loader
GitHub - kk121/File-Loader: File downloading library for android. · GitHub
FileLoader.with(this) .load("https://upload.wikimedia.org/wikipedia/commons/3/3c/Enrique_Simonet_-_Marina_veneciana_6MB.jpg",false) //2nd parameter is optioal, pass true to force load from network .fromDirectory("test4", FileLoader.DIR_INTERNAL) .asFile(new FileRequestListener<File>() { @Override public void onLoad(FileLoadRequest request, FileResponse<File> response) { File loadedFile = response.getBody(); // do something with the file } @Override public void onError(FileLoadRequest request, Throwable t) { } });
Starred by 133 users
Forked by 35 users
Languages   Java
Top answer
1 of 6
55

This is some working code I have for downloading a given URL to a given File object. The File object (outputFile) has just been created using new File(path), I haven't called createNewFile or anything.

private static void downloadFile(String url, File outputFile) {
  try {
      URL u = new URL(url);
      URLConnection conn = u.openConnection();
      int contentLength = conn.getContentLength();

      DataInputStream stream = new DataInputStream(u.openStream());

        byte[] buffer = new byte[contentLength];
        stream.readFully(buffer);
        stream.close();

        DataOutputStream fos = new DataOutputStream(new FileOutputStream(outputFile));
        fos.write(buffer);
        fos.flush();
        fos.close();
  } catch(FileNotFoundException e) {
      return; // swallow a 404
  } catch (IOException e) {
      return; // swallow a 404
  }
}
2 of 6
12

Permission

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

Download Fuction Code

 public void downloadFile() {
        String DownloadUrl = audio1;
        DownloadManager.Request request1 = new DownloadManager.Request(Uri.parse(DownloadUrl));
        request1.setDescription("Sample Music File");   //appears the same in Notification bar while downloading
        request1.setTitle("File1.mp3");
        request1.setVisibleInDownloadsUi(false);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            request1.allowScanningByMediaScanner();
            request1.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
        }
        request1.setDestinationInExternalFilesDir(getApplicationContext(), "/File", "Question1.mp3");

        DownloadManager manager1 = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
        Objects.requireNonNull(manager1).enqueue(request1);
        if (DownloadManager.STATUS_SUCCESSFUL == 8) {
        DownloadSuccess(); 
        }
    }
🌐
Quora
quora.com › How-can-I-download-files-from-GitHub-using-my-Android
How to download files from GitHub using my Android - Quora
Answer (1 of 3): The best and easiest way to download files and folders from GitHub using Android, I prefer you to use chrome and then enable the desktop mode and and green colour button ' Code ' will appear and then click on it and then click on download zip. Done! Enjoy The Code.