Related
I don't know what I am doing wrong. I have placed a file called .nomedia in each of the image folders I don't want in the gallery, but they remain.
I've restarted the phone, Force Stop, and Clear Data. I've unmounted and remounted the SD card, manually, and through the USB mount.
Even deleted an image through the gallery and it refreshed.
To create the file I tried:
-touch .nomedia
-creating a file called .nomedia in a text editor
-empty .nomedia files, and ones with something in them
-creating it on the phone, and on the computer
The file has no 'hidden extension' I'm sure of that, especially when I used touch. I can see the file in ASTRO when viewing hidden files, it is correct.
I've either gone completely crazy, my phone is messing with me, or I've overlooked something very simple.
Any one have any ideas?
Running stock 2.2 right now.
Add a "." to the beginning of folder name instead.
Yes, I know that works. But I would prefer not to do that. Because I can't easily browse to those folders, as I need them for other things in different applications, some of which won't let me view the hidden files.
I am beginning to wonder if I should try a wipe of the SD card and put everything back on. It seems that there is something fishy going on.
I've recently done this with several folders on my N1, a few that had ringtone mp3's in it and some others with jpg's I didn't want showing up in notification or gallery.
After remounting the SD card, they no longer showed in Gallery... but you've done lots more than that, so I can't imagine what the problem could be.
I just created a new file using Ghost Explorer, but have also done it in the past mounting the SD card and creating the filename (touch)
Ok, so not sure how I fixed it, because I went the nuclear route. Backed it up, formatted, and copied everything back. Also opened the gallery while it was unmounted, and recreated all the .nomedia files.
Something there fixed it...
Wait a minute, maybe not... I don't see any images apart from the Picasa linked ones
The logcat actually showed that it was finding and ignoring .nomedia files though.
Well, I'll just have to find a happy medium. I'll give it some time to see if it will scan for more, and check for extra .nomedia in the wrong places.
Oh how lovely, they're all back. And I still see a whole lot of .nomedia being ignored in the logcat.
Eh, enough fiddling for the day.
Could you show us the lines in logcat where it's ignoring .nomedia?
Oh, it's not very helpful. No mention of the directory. Just a lot of lines saying
Code:
D/ ( 3214): found .nomedia, skipping directory
Over and over, exactly the same.
You say you placed a file called .nomedia in folders you want hidden but they still show. What about folders that already have .nomedia, are they showing as well? Maybe, if you haven't tried. Copy an orignal .nomedia file from a folder not showing up in your gallery to your personal folders.
It sounds like you created the .nomedia file from your phone directly. I don't know how that works, but here's what worked for me:
Open text editor (notepad in Windows), File -> Save As, give ".nomedia" as the name, and under "Save as type", use "All files". This made a file that worked for me.
Also make sure you have the file browser showing file extensions, so you know that .nomedia file isn't actually .nomedia.xxx.
Sistum Id said:
You say you placed a file called .nomedia in folders you want hidden but they still show. What about folders that already have .nomedia, are they showing as well? Maybe, if you haven't tried. Copy an orignal .nomedia file from a folder not showing up in your gallery to your personal folders.
Click to expand...
Click to collapse
Yeah, I've tried that too, what I think is that there is some sort of cache or something in the gallery app that I an't get rid of. I've tried another gallery app form the market, and it works with the .nomedia perfectly. If this really ends up driving me crazy I'll wait until I flash CM6 and see if that fixes it, just don't want to right now while I'm away on vacation.
cigar3tte said:
It sounds like you created the .nomedia file from your phone directly. I don't know how that works, but here's what worked for me:
Open text editor (notepad in Windows), File -> Save As, give ".nomedia" as the name, and under "Save as type", use "All files". This made a file that worked for me.
Also make sure you have the file browser showing file extensions, so you know that .nomedia file isn't actually .nomedia.xxx.
Click to expand...
Click to collapse
No, if you read my original post I've created the file many times, many ways. I know about extensions, I know how these things work. I've always just used touch before to do it, but this time since it didn't work I tried many other ways just to be sure. ls -al on the directory shows it is .nomedia exactly, nothing more, nothing less.
Clarkster said:
Yeah, I've tried that too, what I think is that there is some sort of cache or something in the gallery app that I an't get rid of. I've tried another gallery app form the market, and it works with the .nomedia perfectly. If this really ends up driving me crazy I'll wait until I flash CM6 and see if that fixes it,
Click to expand...
Click to collapse
Yeah i'm in the same boat, i've got Google maps icons in the gallery and some other assorted stuff that doesn't belong there. Did a Google search on the .nomedia thing, tried to incorporate a .nomedia (TXT) file into the offending folder a couple different ways but they're still there. I think i'll do the same, flash CM6 then go from there.
Interesting thought about the cache thing, I wonder if it could be something related?
Did you all clear the Media cache? I'd say force close it, clear its cache, then relaunch it?
Something weird is going on.. I had this happen too, but only because I hadn't remounted my SD card.
khaytsus said:
Did you all clear the Media cache? I'd say force close it, clear its cache, then relaunch it?
Something weird is going on.. I had this happen too, but only because I hadn't remounted my SD card.
Click to expand...
Click to collapse
Yup, I mentioned that in the first post. Force stopped it and cleared the cache.
There seems to literally be nothing left to do other than try a complete wipe, which I will do when I get CM6 on it.
Hey all,
Anyone know if its possible to exclude certain directories (or only scan certain directories) from the media scanner? I have a bunch of games on my phone that put audio / video files on the SD card. The media scanner picks these up and means when I am in music player I have thousands of tiny sound effect files from the games listed. Bit annoying to say the least
i believe you can get around this by adding a file .nomedia into the directory
ive never tried it personally but thats the way. a google search for .nomedia on android will probably point you in the right direction if no one can give u a 100% answer.
this link may provide more information:
code.google.com/p/android/issues/detail?id=3692
might be worth trying on a test folder first.......
Sweet, that works a treat.
Thanks!!
Yep, worked here too...saved me from makin a post
Sent from my DROIDX using Tapatalk
Grims said:
Yep, worked here too...saved me from makin a post
Click to expand...
Click to collapse
..... did not.
So this post is over a year old but you know what it was useful and also worked for me!
and here is free app from market to do that =)
StudioKUMA .nomedia Manager
Do not apply this
Did any of you actually read the issue report mentioned by OrionTC? (code.google.com/p/android/issues/detail?id=3692)
It says that if you place a .nomedia file in a directory, all media files that were previously indexed inside will also get deleted from the file system because of a bug!
The bug report was officially closed on May 3rd but if there ever was a working fix, it hasn't made it into any major distribution of Android 2.2 and upwards.
So if anyone finds this thread (like me) and applies the .nomedia solution without reading the bugreport (luckily unlike me), I hope they see this warning.
Do not apply this solution if you care about any of the files inside the affected folder (+ recursive folders inside)!!
Apparently I'm not even affected by this, but I'm on a custom ROM so it's not clear who put the fix in or whether I tested this correctly.
On the issue report there's a Nexus S user confirming the issue on his stock Android 2.3.4.
Please subscribe to the reopened issue report code.google.com/p/android/issues/detail?id=19798 and comment there if you're able to reproduce this on your device. (use a test folder!)
emmm...
I DO NOT know what is written somewhere.
I know what I DID.
So, let me make one suggestion to you: before posting: check.
On stock Froyo, then JVQ/JVR - i NEVER experienced this, although I put .nomedia files on.... some directories.
ALL files remain visible, and can be view/transferred.copied if I want.
Again: try. Make: dummy folder on SD card, copy ONE jpg there, and then - make .nomedia file there.
Browse, edit, reboot, make whatever you want. then: delete .nomedia file. Browse with gallery, and whatever you want.
TIP: your link refers to i-897 model, we are here with i-9000. then: sorry, mate, but who's so stupid idiot, who expect that AFTER FACTORY RESET, his/hers files will remain?
Isn't it obvious, that during factory reset you shall remove card/copy your files?
Let me just remain you: FACTORY RESET should format ALL your files, not the media ones, and if any of your file is remaining - this is a bug.
This is a general issue at the core of android, just happens to be discussed in the I9000 forum. I found it through Google.
The factory reset in the new issue report isn't important. This is also reported to happen after a simple remount of the sd-card.
Factory resets shouldn't touch the sd.
As I already stated, I couldn't reproduce the problem myself, but since people of various models and Android versions reported this, including Nexus S, I think it's important to point that out.
I couldn't in good conscience give the .nomedia advice to anybody, as long as the bug hasn't been confirmed dead for some time. It's just too gross and too risky.
Nomedia trick is safe...the folder n all sub folder will be excluded in media scanning. It doesnt delete or adds files...it just scan..
Thread closed. Problem solved already.
Sent from my GT-I9000 using XDA App
I'm not sure about Samsung, but I've just lost 10GB of videos because of this bug on HTC Desire S, [Endymion V2.1|Sense 3.5|GB 2.3.5].
The problem is when media scaner "knows" about your files, and you add .nomedia. After next rescan are all media files deleted. Not by mediascanner itself, but by some job connected to mediascanner database.
Horacek said:
I'm not sure about Samsung, but I've just lost 10GB of videos because of this bug on HTC Desire S, ....
Click to expand...
Click to collapse
I'm not sure about Samsung, but uncle of my grandma's sister's nephew lost his pants when entered the church. We all think that it was a God's will... and is common to SGS same way as your post...
holy shmoly youve got my banana face moulded in concrete award for that one
I know this is an old thread, but since this is one of the first results when googling how to hide directories from media scanning, I'm reporting here that the ".nomedia" solution had always been the official solution: https://developer.android.com/guide/topics/data/data-storage.html.
Hiding your files from the Media Scanner
Include an empty file named .nomedia in your external files directory (note the dot prefix in the filename). This prevents media scanner from reading your media files and providing them to other apps through the MediaStore content provider. However, if your files are truly private to your app, you should save them in an app-private directory.
Click to expand...
Click to collapse
The bug reported by @OrionTC should be no more relevant in recent Android versions.
So I have a folder called 'Icons' on my SD card. When I download an icon from the browser it goes into the 'downloads' folder. I goto my file manager and move the icon from 'downloads' to 'Icons'. Then I goto Gallery and see this:-
One instance of the Icons folder without the newly downloaded icon
A 2nd 'Icons' folder with only the newly downloaded icon and nothing else
the downloads folder still showing anything that I've moved across to the Icons folder or any other folder
I have rechecked the folder and file structure on my PC and the Gallery is definitely wrong. I only have one Icons folder and nothing in my downloads folder. The horribly slow refresh of the Gallery app is a common issue isn't it?
Aaarggh these annoying imperfections on the Nexus One really drive me nuts! I don't understand why Google, at times, produces these half-baked applications.
It's not half baked, did you rescan the media on the mSD card?
Thanks for the reply. How do I rescan media? A Google search on "android rescan media sd card" doesn't help me
Look in dev tools -> media scanner. (application on the phone)
That function is usually called after the sdcard has been unmounted after transferring files to the card.
PS. I don't find the gallery to be slow by any means, but I don't have thousands of pictures on it either. (not saying that's your case, just an over exaggeration)
evilkorn said:
Look in dev tools -> media scanner. (application on the phone)
That function is usually called after the sdcard has been unmounted after transferring files to the card.
Click to expand...
Click to collapse
Sorry, where is dev tools or media scanner? I think my original post needs a bit more clarification. I actually moved the files across from one folder to another using Estrongs File Explorer. I then reconfirmed the directory/file structure (after Gallery acted funny) using both ES File explorer and my PC.
evilkorn said:
PS. I don't find the gallery to be slow by any means, but I don't have thousands of pictures on it either. (not saying that's your case, just an over exaggeration)
Click to expand...
Click to collapse
I only have 21 images on my sd card (2 in camera folder, 15 in 'icons' folder and 4 in 'wallpapers' folder). I have absolutely zero issues with the speed of the Gallery app. My complaints are to do mainly with behaviour. I've just rebooted the phone, and Gallery still isn't able to identify the folder structure properly.
Connect USB to PC, mount and unmount your SD card.
That should do it.
TT1986 said:
So I have a folder called 'Icons' on my SD card. When I download an icon from the browser it goes into the 'downloads' folder. I goto my file manager and move the icon from 'downloads' to 'Icons'. Then I goto Gallery and see this:-
One instance of the Icons folder without the newly downloaded icon
A 2nd 'Icons' folder with only the newly downloaded icon and nothing else
the downloads folder still showing anything that I've moved across to the Icons folder or any other folder
I have rechecked the folder and file structure on my PC and the Gallery is definitely wrong. I only have one Icons folder and nothing in my downloads folder. The horribly slow refresh of the Gallery app is a common issue isn't it?
Aaarggh these annoying imperfections on the Nexus One really drive me nuts! I don't understand why Google, at times, produces these half-baked applications.
Click to expand...
Click to collapse
It rescans the card when it's mounted, but not all of the time, so if you manipulate it with a file editor it won't see the changes.
So remount the card, or if you do this often, there's a Market app.. http://www.cyrket.com/p/android/com.humanrobot.scanmedia/
Somehow I messed up setting up my wife's new Moto X. In the past I had some tasker tasks to transfer all the photos off our phones and onto our NAS every night. In setting up the task on her new phone I deleted a slew of pictures. I know the original photos are gone and I'll face the music on that one. However, if I go to camera and swipe to the left I can scroll through all the photos. I can't email or share any because the file is gone, but if I can see the photos there must be a low res image someplace on the phone still. Anyone know how to access these and possibly get me out of the doghouse? They're not in the DCIM folder at all. I poked around in the Android/Data folder a bit, but did not find them.
On the same note, is there a way to clean these out over time? Seems to me if I have a thumbnail of every photo ever taken it would eventually fill up the storage.
Thanks
Get an app like astro file manager, or root Explorer and go to storage then DCIM and your thumbnail pics should be there.
Sent from my XT1097 using XDA Free mobile app
clskier said:
Somehow I messed up setting up my wife's new Moto X. In the past I had some tasker tasks to transfer all the photos off our phones and onto our NAS every night. In setting up the task on her new phone I deleted a slew of pictures. I know the original photos are gone and I'll face the music on that one. However, if I go to camera and swipe to the left I can scroll through all the photos. I can't email or share any because the file is gone, but if I can see the photos there must be a low res image someplace on the phone still. Anyone know how to access these and possibly get me out of the doghouse? They're not in the DCIM folder at all. I poked around in the Android/Data folder a bit, but did not find them.
On the same note, is there a way to clean these out over time? Seems to me if I have a thumbnail of every photo ever taken it would eventually fill up the storage.
Thanks
Click to expand...
Click to collapse
Those are probably all cached. As for recovering them, I'm sure you can find them in the cache -- I don't know where they'd be saved (I believe there is a /cache partition but then there's also the possibility that the gallery caches those previews somewhere in /data/). It may be easier to to screen shot the ones you want.
EDIT: see above post - that's probably what you want
As for the cache growing, I'd imaging that the gallery app has some sort of maintenance. But there is always the option of using apps (I have SD Maid, personally) and/or periodically clearing the cache partition via a custom recovery
Thanks all. This was good info also. I ended up finding the files on my NAS which leads me to a whole other question which I will post seperately from this as it only related by symptoms.
6-13-21 See post #4 below for a new automatic version of the app!!
My original intention was to look into updating this project for FW 1.21 but my eyes got bigger and bigger as I realized how difficult that would probably be for me. So here's maybe the next best thing for now.
This is a manual one-touch app which extracts the record of the currently read book from readerlocal.db, selects the appropriate cover image from .docThumbs, and copies it into a folder in /media/screensavers. A short "flash" confirms the operation.
Requirements:
1. Root
2. Superuser
3. sqlite3 in /system/bin
4. the folder "CurrentBookCover" in /media/screensavers
5. Stock Library and Reader
6. Default file storage for books and docThumbs
To install:
Download sqlite.zip (thanks to Nookie!), and the apk below. Extract sqlite3 from the zip file and copy it into /system/bin. You will probably have to change permissions (give write permission to all) and then change them back. File permissions on sqlite3 should be rwx r-x r-x or CH MOD 755.
Create the folder "CurrentBookCover" in /media/screensavers. Install the app either via ADB or by copying the apk file to your Nook and installing from a file manager. Use the NST "Settings" app to select the new screensaver folder.
You can run the app at any time. Repeats on the same title will simply overwrite. My experience with this app is that it is sluggish on first run. It seems to take a long time for SuperUser to wake up and notice the request. It may seem to fail after you initially give it permission. Run it again and it should be fine--and thereafter.
Which books?
As long as side-loaded books are in the default folders (internal: /media/My Files/Books, external: /sdcard/My Files/Books) they will be fine. Sub-folders within the "Book" folders are also OK. The reason for this restriction is so that the .docThumbs folders in which the Library places the cover images will be in a predictable place. A "settings" section would be nice to allow for some leeway, but that is beyond me and, in any case, it's the stock Library app that determines where the .docThumbs folders will go.
B&N downloaded books do not have cover images in a place where they can be found (by me, anyway). The books themselves appear to reside in /data/media/B&N Downloads and are listed by code numbers, not titles. Although the app can detect the downloaded books, there is no corresponding .docThumbs folder and so no cover images. Nothing will be copied to the screensaver folder and your default image will appear instead. However, if you want a cover image you can make one of your own for the book and copy it into /media/.docThumbs (create the folder if it's not already there). The name of the file should match the code number of the book. Something like 9780062020765.jpeg or whatever.
PDFs also do not have cover images which the Library can extract. The situation is exactly the same as for B&N downloaded books. You will get your default screensaver if you run the app. If you want a cover image just be sure to give it the same name as the PDF file and place it either in /media/.docThumbs (for internal memory) or /sdcard/.docThumbs (for external memory). Of course, there will be no thumbnail in the Library no matter what.
Books transferred using Adobe Digital Editions are like books from B&N in that they are DRM protected, although the exact nature of the DRM protection is apparently different. These books end up in /media/Digital Editions as titled epub files but no cover image is either generated or can be extracted because of the DRM. A cover thumbnail is generated in /media/Digital Editions/Thumbnails but it is very low resolution and might be suitable for the Library cover image but in my experience the NST/G is not able to find it. If you manually move the epub file to a location where other books are generally stored there is no docThumb file generated and you still don't get a cover image in the Library. So....well, there is no good solution other than to manually place a cover image of your own in the screensaver folder. Alternatively, you may choose to remove the DRM protection before transferring the book (i.e., do not use ADE to transfer) and then treat it as a regular side-loaded book. Everything will then work as expected.
This is a Tasker-generated app and my personal hope (since I use Tasker on my NST) was to make a Profile that would run this routine automatically when a book was accessed in the Library, completely silent. This has proven to be something of a puzzle as it's not clear exactly when the database is actually updated and attempts to make the task watch for that event have not been successful. Yet. I welcome any insights into that. I've never seen the app fail to pick up the correct cover.
Please report bugs/problems/suggestions.
Edit: I have recently discovered that these apps--and all Tasker-generated apps--have a dependency on two library files normally installed with GApps. If you do not have GApps installed on your device, you can still use these apps by copying the two attached files into the locations shown below (the xml file is zipped so you can download it rather than view it):
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar
Set permissions for both files to rw-r--r-- and reboot.
Very nice job, @nmyshkin! I will be testing this within the next several days and will most likely post again with bugs/feedback.
mergen3107 said:
Dear nmyshkin!
Do you know how to stop Nook from creating .docThumbs?
I got rid of stock Reader and Library, so I don't really need that folder. Also all my books are in internal storage (thanks to partition resize) and now it is crucial to free up more space.
Click to expand...
Click to collapse
The short answer is "no". The longer answer starts with "how much space could an empty folder take?" and then:
Are you still storing your books in the default (internal) folder (/My Files/Books)? The reason I ask this is that when I was working on the SetCover app I originally had no books in the internal default folder and the .docThumbs folder did not exist (unlike on the SDCard where I had all my books in the default folder there and the .docThumbs folder came into existence without me creating it). I did have some "free Friday" downloaded books in internal memory but they do not generate .docThumbs.
So my point is that I actually had to create a .docThumbs folder in the internal space just so I could test my SetCover app. My guess is that if you don't have to store your books in /My Files/Books and you put them somewhere else, no .docThumbs will be generated. I would have guessed that this is a background task of the Library when it scans the folder but if you say you have removed the Library then it must occur in some other way.
Just try one book in a different folder (if however you are accessing the books will allow that) and see if the cover image shows up in .docThumbs.
6-24-23: Updated to version 3.1
--removed dependency on Screenshot Easy (you can uninstall it)
--added small binary file, fb2png, to replace malfunctioning native screenshot binary
Some years have passed since I created the original app. It works fine, but I've always wished it could be automatic like some of the non-B&N readers (Cool Reader, AlReader). So with a little more knowledge and foolhardiness I returned to the project I referenced in the original post. I sorted out the patches to the old FW 1.10 and applied them to FW 1.2.2. Then I got stuck at the Settings .apk because of the signature issue. The OP never disclosed how he got around that issue, but I could not.
[nmyshkin thinks...]
I went back to my original app and reviewed the problem. What I found was that while the database files are open when a book is being read, they do not appear to be updated unless the reader is "closed" (i.e., no longer the focused window). So how to trigger the cover extraction without constantly scanning the system....
Eventually I abandoned the databases when I came up with a much simpler idea.
Spoiler: How it works
The cover extraction routine is triggered by exiting the Library and opening the selected book in the Reader. Actually, there is a ten-second wait time in case there is some kind of delay in opening the book or the file is very large. After 10 seconds, if the ReaderActivity is in focus the system is queried for open epub files:
Code:
#lsof | grep epub
The resulting string contains all the information needed to locate the book, and a bit of slicing and dicing yields a suitable string to locate the correct image file in .docThumbs. The image is then copied to the folder /media/screensavers/CurrentBookCover. If you have entered and left the Library without selecting a book to view then the process stops and there is no update to the screensaver image. If you select a book by some other method (via a file manager, for example) the routine will not be activated.
The app works for any side-loaded books (internal or external, in any directory), assuming you are using the stock Library and Reader. It won't work for any other books such as public library books transferred with ADE, PDFs, or books purchased from B&N. This is because the B&N software does not extract cover images from these kinds of files to place in .docThumbs. Based on my reading of the original project that got me started on this, that was also the case with that mod. If there is no cover image available, your default screensaver image will show.
A kind of solution
This version of the app includes the ability to take a screenshot manually. That means you can take a screenshot of the cover that might be displayed when you open one of the non-compliant books in the Reader (or even a book open in the Kindle app, etc.). It's not perfect and results vary depending on how the cover is displayed. If you have a gallery app like Quick Pic installed you can use it to crop the image to your liking. Of course, you can always get your own cover image elsewhere and place it in /media/screensavers/CurrentBookCover. I should add that this ability extends beyond book covers. Any displayed screen can be copied and the image will be placed in the folder. That might be useful.
This added capability uses Screenshot Easy as a plugin app (also used in my Alternate Power Menu and Screenshot apps). Images are initially saved in /sdcard/Pictures/Screenshots and then moved to /media/screensavers/CurrentBookCover.
Installation and setup
1. Create the directories: sdcard/Pictures/Screenshots (if not already existing) and /media/screensavers/CurrentBookCover
2. In the Nook Settings app select "CurrentBookCover" as the screensaver directory.
3.From the zip below, copy fb2png to /data/local, set permission to rwx rx rx
4. Download and install the Set Cover app (below). This is a Tasker-created app and requires the presence of two small files, included in the zip. Without these files present the app will not install! If you already have one of my other Tasker apps, you can discard the files. Otherwise copy the two included files into the locations shown below:
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar
Set permissions for both files to rw-r--r-- and reboot. Then install the Set Cover app.
The app requires root. I have set it up so that on first run it does something trivial that requires root so that it will trigger SU and ask for permission. Once that's out of the way, subsequent taps on the app icon will take a screenshot. Of course that's not very helpful since you can't get to the app to tap when you're looking at a book cover in the Reader! You can set a hardware button (regular or long press) to the app using NookTouch ModManager. That way you can do a manual screen capture no matter where you are in the system.