Answers for "how to download pdf file from firebase storage and save in external private storage in android"

1

how to download pdf file from firebase storage and save in external private storage in android

public long downloadFile(Context context, String fileName, String fileExtension, String destinationDirectory, String url) {


     DownloadManager downloadmanager = (DownloadManager) context.
            getSystemService(Context.DOWNLOAD_SERVICE);
     Uri uri = Uri.parse(url);
     DownloadManager.Request request = new DownloadManager.Request(uri);

     request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
     request.setDestinationInExternalFilesDir(context, destinationDirectory, fileName + fileExtension);

     return downloadmanager.enqueue(request);
}
Posted by: Guest on March-28-2022

Code answers related to "how to download pdf file from firebase storage and save in external private storage in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language