Search code examples
androidfileblacklist

Android - How can i create a "black list" for the files of my application


In my app i have many files (images and audio files). There is a way i can "mark" this files so that they cannot be read from other app like music player for the audio and gallery for the images? My question is: i can create a sort of "black list" that prevents to other app to see my files?

EDIT

As was recommended to me, i try making a ".nomedia" file into the folder that contains my files in this way:

File no_media_file = new File (my_path, "/.nomedia");
try {
     no_media_file.createNewFile();
} catch (IOException e) {
     e.printStackTrace();  
}

the file ".nomedia" is created correctly (i verified using "ES File Explorer") but if i open "play music" app i can still play my audio file... Where am i doing wrong?


Solution

  • I solved my problem by inserting my files in a folder named like this: ".my_folder" and it's worked!