Android: Save Data To Internal Memory Using Download
I am downloading file from a server in Android using the DownloadManager class. I want to store this file in the internal memory of the device. I tried to use .setDestinationInExte
Solution 1:
add
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
to manifest.xml and create "/Android/data/xxx.xxx.xxx/files/" path
Solution 2:
try this
File testDirectory = new File(Environment.getExternalStorageDirectory() +"/Android/data/xxx.xxx.xxx/files/");
and
if (!testDirectory.exists()) {
testDirectory.mkdirs();
}
Post a Comment for "Android: Save Data To Internal Memory Using Download"