Question

In my application I'm recording mp3 & stored it in sd-card. I do not want to allow these files in default media player list.

But when I start media player for playing songs the recorded files also gets appear in the list. How can I stop loading my applications folder of mp3 in media player?

Was it helpful?

Solution

Source : http://alexborisov.org/hide-media-files-from-android-media-scanners/

By default Android will scan your phones memory for any audio, video and pictures and add them to the media player/gallery by default. There are many reasons why this could be annoying. First there might be applications that use audio files (say a gps program). If the developer was inexperienced and/or lazy (and lets face it – most mobile developers at the moment are) no steps were taken to hide these files from the media scanner and they will show up in your music player. You might also have pictures/videos that you would not like to show up in the gallery. There exists a simple mechanism in Android to prevent this and it’s very similar to the way the robots.txt file works to control search engine spidering on websites (you can see where Google got the idea :P).

Simply create a blank file and call it .nomedia. Whatever directory this file is placed into will indicated to the Android media scanner that any media files inside this directory should not be indexed and left alone.

You can do this on the phone via Astro (or a similar file manager) or a terminal app (just do ‘touch .nomedia‘ – touch is a unix command that will create the specified file, but not actually populate it with any content).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top