In my android app I want to download a file from web server to Mobile's Internal Storage using Download Manager in android studio. And also i need to use it inside the Volley function.
My Code
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png");
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalFilesDir(DownloadsActivity.this, Environment.DIRECTORY_DOWNLOADS, "banu.jpg");
}
In above code I had tried it in button click.