I am trying to download image from webview in custom folder of Android app. As of now i can only download file in Download
folder by using below code.
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(imgUrl));
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager downloadManager = (DownloadManager) getActivity().getSystemService(DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
Is there any way to store image in other folder (newly created folder) instead of default Download
folder. Actually i want to download image in Android app folder that will be private and not accessible to user via File Manager or other Apps.
I tried to create folder by using following code but folder is creating under /Android/data/com.abc.xyz/
is there any way to create folder directly under internal storage (under root directory) ?
File direct = new File(Environment.getExternalStorageDirectory()+"folder_name");
if(!direct.exists()) {
if(direct.mkdir());
}