String path = "/mnt/external_sd/download"; File file = new File(path); if (!file.exists()) { file.mkdirs(); } String command = "chmod 777 " + file.getAbsolutePath(); Runtime.getRuntime().exec(command);
request.setDestinationInExternalPublicDir("/download", fileName);
其中,request为DownloadManager.Request,fileName为下载的文件名。此方法将文件下载到可移动存储的download文件夹中。