I have a chat app where users share images/video/audio etc. I need organized my directory structure, where i need to keep sent files in separate sub-folder and hide it from gallery apps but user can able to locate with file manager apps.
The only things comes in my mind that create .nomedia file in sent folders but in android 11+ we can't create files just like that. Our users gallery apps messed up with sent and receive images, I am not able to find any solution on StackOverFlow and on other documentations or google search.
On Android 11+ i am using MediaStore to read and write media files. Anyone have any idea how can i create .nomedia files in External Storage like Pictures/Movies/Documents etc.
I am creating .nomedia below andoird 10 like this but i have no idea how to create in android 11+
File file = new File(dir+".nomedia");
file.createNewFile();