Which way we should go to solve this, what do you think?
It won't be easy for anyone...
But, after the last [LAMW] update I think we have a consistent behavior ...
All we need for now is to inform developers that for Android 11
the trivail/popular/extern folders (Picture, Download, .....) are no longer accessible and are replaced for
homonymous/namesakes in the application space ..... which are initially empty!
//This is the legacy solution that preserve the old/deprecated behavior for Android <= 10
private File getMyEnvDir(String environmentDir) {
if (Build.VERSION.SDK_INT <= 29) { // <<----legacy
return Environment.getExternalStoragePublicDirectory(environmentDir);
}
else {
return controls.activity.getExternalFilesDir(environmentDir);
}
}
I do some test here and it works! (You can try, again, AppOpenFileDialogDemo1)
but:
1) First click the button "Get File List" to put/write some files in directory [if you want to test "Picture" folder change the code ....]
2) Click the button "jOpenDialog1.Show()" and the pop-up will show the file names write in sep (1)