Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);
}
Comment

PREVIOUS NEXT
Code Example
Java :: xAxis.setTextSize() text gets clipped 
Java :: cannot set char field to null value java 
Java :: Spring Boot Hibernate remove underscore naming strategy 
Java :: ISO week date java 
Java :: character classes in regex 
Java :: android navigation bar color change 
Java :: android action key 
Java :: node-red-docker 
Java :: print 2d array in java 
Java :: get id of html tag by class 
Java :: big integer input in java 
Java :: how to add a keylistener to a jframe 
Java :: create map java 
Java :: separate string by comma java 
Java :: java public static void main 
Java :: java add listent to button 
Java :: how to convert an object into string with different fields in java 
Java :: how to play an audio file in java 
Java :: jframe button 
Java :: iterator constructor java 
Java :: java main class 
Java :: papermc api maven 
Java :: how to close android app programmatically 
Java :: testException = com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field 
Java :: how to instantiate hashmap in java 
Java :: java get number of days in month 
Java :: package within another java 
Java :: Get the first day of the current month in Java 
Java :: spring boot intellij auto reload 
Java :: java print text with variables 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =