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

311 views Asked by At

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?

1

There are 1 answers

0
madmad On BEST ANSWER

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