Apps Ignoring .NOMEDIA Files? This is Probably Why

ignored nomedia
Not long ago while flipping through Reddit I came across a post of an internet stranger that had trouble hiding some folders containing images from WhatsApp's Gallery: that is, the in-built gallery that scours your devices storage for media and allows you to pick stuff to share or post.

What I found peculiar about his problem is that he had done everything right and yet it had not worked as expected. Basically in Android the quickest way to hide folders containing all kinds of media (images, videos and audio) is to use a .nomedia file which tells media storage (i.e. Android's system media scanner) and other media apps not to look in those particular folders.

Our friend here had done just that and it had not worked out for him. So I tried on my phone and oddly enough, it didn't work for me too. With no other solution at hand, I suggested he hide the complete folder by renaming it to start with a dot. That was guaranteed to work and it did for him, though in retrospect I wish I had suggested something better now that I've sort of figured out the culprit behind our woes.
Example of a .nomedia file

WhatsApp Ignoring .nomedia Files?

Well, at first that's what I thought and for a moment there I had started admonishing WhatsApp developers from my lofty consumer throne for gross incompetency. "How could they? What are they possibly doing all those Facebook billions...". And in case you're wondering: yes, all this was taking place in my head, not in the Twitter Colosseum. 

So as it turned out it wasn't WhatsApp fault that it wasn't hiding the folders. That rested squarely on Android since WhatsApp seems to rely entirely on the stock gallery listings (which uses Media Storage) to populate its gallery. Now that could be an oversight on WhatsApp Devs since it's a well-known fact that media storage is not the best of media scanners. In the early days, at least from my Gingerbread experience, it was a resource hog. Five years later and nowadays I'm realizing it just became "lazy". The stock gallery app on my marshmallow device was missing some media folders, and now it seems it was blatantly "ignoring" all the .nomedia files I was creating. But was it?

The "Attributing" Culprit

As I've come to find out the problem isn't media storage's per se. The file manager I was using, and likely the one you're using, is partly to blame. Personally I've been a long time user of FX File Explorer and it's what I've been using all along to create .nomedia files. All the apps I typically use (QuickPic, MX Player) respect it's .nomedia files however it seems with the exception of the Stock Gallery.

So I had a hunch that the file manager was to blame and decided to use another other file manager to create the .nomedia file. I used the excellent MiXplorer and surprisingly, this time it worked; both the stock gallery and WhatsApp had complied. But why?

Well I set out to investigate precisely that. What I found out after copying and comparing the two .nomedia files in my Windows 7 computer, is that they had different file attributes. FX was creating the .nomedia with the A(rchive) attribute while the one from Mixplorer had the N attribute which after some Googling seems to indicate that it stands for Normal or No Attributes. Not quite satisfied, I removed the A attribute from the file and copied it back to see the result. Sure enough it worked.

The problem it seems is that Media Storage simply just ignores .nomedia files with attributes. To verify my theory, I've since tried the same with another file manager (Amaze) and it failed to work for the same exact reason - the A attribute.


Since I don't know the extent of this problem, let alone authoritatively verify its existence, my two cents are that should you find yourself in this situation, just try using another file manager to create the .nomedia file. MiXplorer for one seems to work for me though I'm sure it's not the exception.

If you don't want to install another file manager which is quite understandable, you can reuse a .nomedia file that already exists in your storage. WhatsApp creates some in its WhatsApp Media subfolders. You can reuse those but make sure when copying that you use the Stock File Manager or the in-built Explorer found in the Storage and USB settings (Android 6.0 later). I'm only saying that because in my case FX seems to give it the attribute when copying too.

A better way out of all this madness, which is rather trivial actually, is to just use apps that use their own media scanners. They're way better than any of the stock apps anyway. For my gallery needs I use QuickPic (the last version before it got sold) and for video I use MX Player. Those serve my needs quite excellently.

With regards to WhatsApp's gallery, if you've never realized, WhatsApp does actually allow you from the three dots at the top left to use other gallery apps to pick content. You don't therefore have to be stuck with the inept stock gallery.
Other Media Pickers

On the other hand, if your primary concern is not to hide the clutter of unwanted media folders from your gallery but to keep prying eyes away, then you're better off using something more secure like folder or gallery locker apps. If you take your privacy very seriously, apps that allow you to manually encrypt your files or folders should meet your needs. If not, perhaps consider not getting the need to hide anything in the first place. It’s no doubt the most secure and anxiety-free way.