After a long time, when the application starts without any problems, I received a report form in which the user reported that the data / photos that were saved were lost. That is, it can work at the initial stage, but at a later stage, the content disappears. I canβt duplicate the problem, so Iβm trying to figure out if I can βguessβ it.
First of all, make sure that I do not save the data in a way that is not possible for recent versions of Android. This is how I save data now:
...
Try first
File storage_files_dir_file = ctx.getExternalFilesDir("");
if (storage_files_dir_file.exists() == false) {
return false;
}
os = new FileOutputStream(path_final,true);
MediaScannerConnection.scanFile(ctx, new String[] {s}, null, null);
return true
If the above value returns a false switch on
File storage_files_dir_file = ctx.getFilesDir();
if (storage_files_dir_file.exists() == false) {
return false;
}
os = new FileOutputStream(path_final,true);
return true
...
If this is a problem with the file, I see the following possibilities:
- Problem with data access?
- Are saved files deleted by Android?
- ?
- , SD- ?
- , , SD- ?
- ?
- : Android 8 ?
- : Android 8 +, . , .
, , , , , , .
...
2017 .
, Android 8 Oreo. , , ? + , , , -? : ? ?
- , Android 6 Android 7, , Android.
...
- , , ? , .