I need to download a file to the getFilesDir directory of android so it is only accessible by the application. I am currently using Download Manager and I can only specify the Environment type. Please can I use a custom directory or is there another approach.
This is my download code:
public void download(){
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(videoUrl));
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI| DownloadManager.Request.NETWORK_MOBILE);
request.setTitle("Download");
request.setDestinationInExternalFilesDir(getApplicationContext(),Environment.DIRECTORY_DOWNLOADS, File.separator + "lessons/1234.mp4");
manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
registerReceiver(downloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
}