You can find plenty of apps on Play Store with which you can hide your files or apps from prying eyes. But what about preventing apps (even default Android ones) from accessing certain folders or files?
The typical problem is when your media player (for music) or gallery app (for pictures) indexes default Android files like ringtones, notification sounds, wallpapers and other similar stuff.
On some Android devices such files may be restricted (hidden for the app) by default, but a lot of devices have this problem. Nothing crucial, but who wants to have have his playlist or gallery cluttered by crap?
There exists quite simple solution for this, but most Android users are not aware of it - .nomedia files.
What are .nomedia files?
Android OS uses .nomedia files to prevent apps from "seeing" files in certain folders. It does not mean that these files are hidden from users, you will see them just fine, but some apps that like to index stuff will skip the contents of the folder.
This can be very useful for limiting the access of various picture gallery or media player apps so they do not show certain files.
A typical .nomedia file is just a empty text file (0 kb) with nomedia suffix and no file name. The truth is that any file with no file name and nomedia extension would work, even if it was originally something else, such as photo or song.
How do .nomedia files work?
When a .nomedia file is placed in some folder, it makes the content "invisible" to apps that have access to that folder.
It's easy and efficient way how to restrict apps and you can find these files in several system folders of Android OS.
How to manually create .nomedia files?
You basically have three options how to make .nomedia files and that's it. Each of them will require phone reboot after the procedure is done to apply the change.
Re-use existing .nomedia files
Plenty of .nomedia files are spread in various folders in Android. You can simply locate them with some file manager app (like ES File Explorer) and make a copy of .nomedia file to any folder you want.
Make .nomedia file from some file
You can take any file, photo, song, whatever and simply rename it to no file name and extension nomedia, so you will get a ".nomedia" file. It's usually best to make it from as much smaller file as possible, ideally empty.
Create empty .nomedia file on PC
The last option would be to create an empty text file (.nomedia) on your PC with Notepad and transfer that to your Android phone via USB. Just make sure you have extensions visible in Windows so you can really create .nomedia file with no file name and proper extension.
How to reverse the process ?
If you no longer want the contents of the folder to be hidden for Android apps, simply delete the file or rename the suffix from nomedia to something else.
Is there anything else about .nomedia file?
No, that's pretty much everything and anything you need to know about this Android unique file type.