[Q] Gallery not showing pictures copied via shell command - One (M8) Q&A, Help & Troubleshooting

I've got a potentially interesting issue here. I'm using Tasker to automatically copy my screenshots from the internal storage to my memory card with the cp shell command:
Code:
cp /storage/emulated/0/Pictures/Screenshots/* /storage/ext_sd/Pictures/Screenshots
It works perfectly and I can open the pictures in the memory card from a file manager (I use ES File Explorer, though I doubt that's relevant).
However, the stock Gallery app won't show them. It shows the broken image file graphic of the grey landscape. Rebooting does not make a difference (fast boot is off).
Here's the really interestsing part: if I go into the file explorer and manually move the images from the memory card folder to any other folder and then right back to the same folder, the Gallery app sees the pictures! But that clearly defeats the purpose of automation I was attempting to acheive with Tasker.
Why is this happening and how can I avoid it?

Related

[Q] Why do folders on /SDCARD appear empty through computer?

This is driving me crazy. I want to copy the TitaniumBackup folder from my GNEX to my Win7 PC.
Looking at the folder through Root Explorer on the GNEX all appears normal. When I look at the folder through my computer the folder is showing but the contents are backups that are almost a month older than are on the GNEX. If I delete everything in that folder FROM THE PC it still exists on the GNEX.
It is like it is looking at a different folder entirely however looking and searching through ROOT EXPLORER there are no other TITANIUM BACKUP folders.
This happens with a lot of apps. Example: I created a ZIP file using ROOT EXPLORER. The zip, viewing through ROOT EXPLORER is located in the /SDCARD/SPEEDSOFTWARE/ZIP folder however when I look at the SPEEDSOFTWARE folder via my PC the folder is empty.
I have tried both MTP and PHOTO mode. This happens with a lot of folders when trying to view them from my PC connection. Some stuff is there and a lot is not.
Hmmm, there is a /MNT/SDCARD and a /SDCARD folder (I don't know much about Linux) and the files I am NOT seeing on my PC are in /MNT/SDCARD and the files I am seeing are in /SDCARD. Why are there 2 different "SDCARD" folders? I changed the TitaniumBackup to save to /SDCARD instead of /MNT/SDCARD but the backups are still not viewable (or copyable) from my computer. I just don't get it.
So the question is, how do you "backup" the contents of the "SDCARD" directory if you can't see the files when plugged into the PC?
Well, after comparing all the "visible" files on my computer when I access the GNEX via MTP vs what I see using ROOT EXPLORER the ONLY 2 folders NOT visible from my PC are TITANIUMBACKUP and SPEEDSOFTWARE (thus is the ROOTEXPLORER app data). Why would they be hidden?
It's due to how the Android MTP service works. It hasn't scanned your internal storage for the new files/directory to present to your PC yet.
Download and run an app called SDrecan from the Market. This will force the media services on your phone to rescan the device.
Sent from my Galaxy Nexus using XDA App
Absolutely amazing! Thank you so much! I have been pulling out my hair for days!
thank you! I had the same problem!worked flawlessly!
silow said:
Download and run an app called SDrecan from the Market. This will force the media services on your phone to rescan the device.
Click to expand...
Click to collapse
Thanks! This was really driving me crazy...
is there one for phones on android kitkat 4.4 and up
silow said:
It's due to how the Android MTP service works. It hasn't scanned your internal storage for the new files/directory to present to your PC yet.
Download and run an app called SDrecan from the Market. This will force the media services on your phone to rescan the device.
Sent from my Galaxy Nexus using XDA App
Click to expand...
Click to collapse
this app is force closing. i cant even run it . do you have any idea? just today was working fine , i installed a custom rom and now when i try to put another roms on my sd card , i get this message that it's empty
trickster mod also has a media rescan option in bottom of tools section if this is helpful to you, I have to use it after using the "a better camera app" in order for pics to show in gallery without reboot

[Q] Storage missing/partly hidden

Hello guys,
I have a bigger problem I hope you can help me with...
My internal storage is somehow messed up. This has effects on MTP and on some apps like the stock camera.
When accessing my internal storage by MTP from PC, only a few folders and files are visible. In contrast, if I list the content of "/mnt/sdcard" or "/storage/sdcard0" they show all my files and folders as one would expect. Also, files visible on the PC are inside this path and even when i copy a file from the PC, it is placed here.
The more serious problem is, that some apps are not able to find their files and folders inside die storage anymore. As an example, the camera app asks me to insert a sd card before taking a picture and Winamp doesn't find my music anymore.
What i tried so far:
Copying files from and to storage with Dropsync, FolderSync and ES Explorer: works without problems
I checked the rights of the files with the terminal: nothing interesting there
I cleared my whole storage (thanks to Unlock procedure) and flashed a new Custom ROM
I drank a lot of coffee because it got late
Nothing worked.
Please help, Thanks!
So thats me again.
I finally found the correct allready existing post. In this thread user dlzinc describes that one has to fix the permissions for /data/media. Good to know that i was right with permissions, bad that i didn't go through with it in the first place.
Mazzen

[Q] .thumbdata3 file permanent removal?

Hey guys.
There has been something really annoying me lately. It's the .thumbdata3 file in /storage/emulated/0/DCIM/.thumbnail. Its always like a 200 mb + file and it just takes up wayy too much space on my internal storage. So is there anyway to permanently remove this file for good? Like somehow prevent it from forming again? By the way, i already have the latest albums app so that didn't fix the problem.
Sent from my C2004 using XDA Free mobile app
The only way I know about is deleting the folder .thumbnail and then creating an empty file named .thumbnail (this will prevent the folder being created again). However, be adivised that Album app may get laggy since it'll regenerate the thumbnails every time you open the app or use the photo widget. If you have a lot of them, your phone also may get hot and the battery will go quickly if you keep opening album app various times...
Furthermore, it's hard to know the real size of that file. Yes, it holds some space in internal memory, but it's definitely not the size shown. In my phone, for example, this file show as 870 MB, but once I delete it I get only 50-60MB of space back...
mbc07 said:
The only way I know about is deleting the folder .thumbnail and then creating an empty file named .thumbnail (this will prevent the folder being created again). However, be adivised that Album app may get laggy since it'll regenerate the thumbnails every time you open the app or use the photo widget. If you have a lot of them, your phone also may get hot and the battery will go quickly if you keep opening album app various times...
Furthermore, it's hard to know the real size of that file. Yes, it holds some space in internal memory, but it's definitely not the size shown. In my phone, for example, this file show as 870 MB, but once I delete it I get only 50-60MB of space back...
Click to expand...
Click to collapse
That worked for like an hour. Afterwards when i checked again, i actually found two .thumbnail3 files instead of one. They were both the same size. Any idea why?
Sent from my C2004 using XDA Free mobile app
This trick works only for folders (e.g. if you created empty .thumbdata3 file inside /DCIM/.thumbnails/ it won't work, that file will be replaced next time you open Album app). You need to remove the entire .thumbnails folder from DCIM and then create an empty .thumbnails file in DCIM. Next time it'll try to create the folder again to store the thumbdata3 files but it'll fail because a file with the same name already exist, doing nothing then...
Another way is opening a terminal (or adb shell) and running these two lines of code as root:
Code:
chown 0:0 /data/media/0/DCIM/.thumbnails
chmod 0440 /data/media/0/DCIM/.thumbnails
That way this folder will be accessible only if Album app run with root access (which never occur)
mbc07 said:
This trick works only for folders (e.g. if you created empty .thumbdata3 file inside /DCIM/.thumbnails/ it won't work, that file will be replaced next time you open Album app). You need to remove the entire .thumbnails folder from DCIM and then create an empty .thumbnails file in DCIM. Next time it'll try to create the folder again to store the thumbdata3 files but it'll fail because a file with the same name already exist, doing nothing then...
Another way is opening a terminal (or adb shell) and running these two lines of code as root:
Code:
chown 0:0 /data/media/0/DCIM/.thumbnails
chmod 0440 /data/media/0/DCIM/.thumbnails
That way this folder will be accessible only if Album app run with root access (which never occur)
Click to expand...
Click to collapse
I actually did both of the things you said above. And so far so good. Well done bro, you're amazing
Sent from my C2004 using XDA Free mobile app
mbc07 said:
This trick works only for folders (e.g. if you created empty .thumbdata3 file inside /DCIM/.thumbnails/ it won't work, that file will be replaced next time you open Album app). You need to remove the entire .thumbnails folder from DCIM and then create an empty .thumbnails file in DCIM. Next time it'll try to create the folder again to store the thumbdata3 files but it'll fail because a file with the same name already exist, doing nothing then...
Another way is opening a terminal (or adb shell) and running these two lines of code as root:
Code:
chown 0:0 /data/media/0/DCIM/.thumbnails
chmod 0440 /data/media/0/DCIM/.thumbnails
That way this folder will be accessible only if Album app run with root access (which never occur)
Click to expand...
Click to collapse
Can you please write full adb procedure for noobs please
I think this might be a very helpfull, since that problem exists in virtually all android 4.0+ devices and it is annoying as hell
It's simple. The first option is chown/chmod the .thumbnails folder but it may not work in all phones (however, it works fine in Xperia M). You have two ways to do that:
Using a computer:
1) Enable USB Debugging
2) Plug your USB cable (make sure you're in MTP mode)
3) Open adb shell from Terminal/Command Prompt and run the following commands:
Bash:
su
rm -r /data/media/0/DCIM/.thumbnails
mkdir /data/media/0/DCIM/.thumbnails
chown 0:0 /data/media/0/DCIM/.thumbnails
chmod 0440 /data/media/0/DCIM/.thumbnails
Using only your phone:
1) Install Terminal Emulator app if you don't have it
2) Run the same commands:
Bash:
su
rm -r /data/media/0/DCIM/.thumbnails
mkdir /data/media/0/DCIM/.thumbnails
chown 0:0 /data/media/0/DCIM/.thumbnails
chmod 0440 /data/media/0/DCIM/.thumbnails
If you get errors when running any of these commands, you should install busybox in your device and then try again. Also, as I said before, it may not work in all phones, and if that method failed, you can try the empty file method. In your phone, using a file manager of your preference, go inside DCIM folder and delete the entire .thumbnails folder. Then, create an empty file named .thumbnails and you're done. If this method also fails, your phone have a different filesystem layout (eg. doesn't have an emulated SD Card) and I don't know any method of archiving that in these devices.
Furthermore, be adivised that your gallery may get laggy since it'll regenerate the thumbnails every time you open the app or use a photo widget because you disabled thumbnail cache. If you have a lot of pictures, your phone also may get hot and the battery will drain faster, especially if you open your gallery frequently...

[Q] Weird writing problem on rooted ND8 stock.

Recently rooted my phone thanks to these wonderful people at a place called xda-developers. You may have heard of them.
Anyway, I find that there's something weird going on with my phone, I can't write to the internal storage. External SD card works fine, Internal SD card does not. Only a few apps work.
The camera app will take and save photos, but using the camera within Kik Messenger gives m the error that the photo cannot be saved, I have to take photos with the camera app, then import them to Kik with the "choose photo" option, which will let me choose a photo through Gallery.
In another related issue, ES File Explorer will not create new folders. I'm in the main directory of the "internal" SD card, where things like Downloads and DCIM like to sit in. I cannot make a folder. If I go in with a Windows computer over USB I can make folders fine. ES File Explorer cannot even delete the folder. Says "New Folder cannot be deleted" Why is this? I can even rename the folder, but I still cannot delete this folder. Going into the properties it says I have full read and write access to the folder, I still cannot delete it.
In a third instance I have the GPS program Navfree. I cannot even run the program. Google Play installs it and it says it works, but when I go to actually open the program it gives me the error "Program cannot be installed, contact support" before quitting me back to the home screen. This program is special because it downloads and installs, but there are map files that it needs to download before it becomes useful. This is done within the app and I do not know where it tries to save to.
I think all of these problems are related and I have not seen any forum posting about it so far and I have been searching for a while. Google Play will still download and install apps like no problem and ES File Explorer will copy and move files around and will even rename New Folder to 'folder' but will not delete i
At first I suspected it to be the problem with KitKat and the debacle about writing to /external/ SD cards. But my problem extends to the internal storage as well. I have applied the fix to the 'permissions.xml' file by adding "WRITE_EXTERNAL_STORAGE" I had to flash the fix in with recovery because I could not save the edited file I had typed up. Using one of the automated fixes in Google Play told me the action had already been completed. On the contrary, external storage works fine, I can write files and delete them and whatever I want to the external. The problem is with the internal card and it applies to everything I've tried except the camera.
So what is going on with my phone? I have root access but some apps will not work properly. It's just one headache after another. Here's hoping I won't notice the next one until I get another phone...
Eventually I just got fed up with the problem and re-applied the stock rom with Samsung Kies. Re-rooted and now the problem is no more. Thanks for thinking about me!

[Q] Lollipop still blocking writes to External-SDCard

I just uprgraded to the lollilop gpe OTA. Everything is working as normal, camera, Infrared, light, wifi, LTE radio, etc... I am also rooted.
However, ES File Explorer is still unable to modify the contents of the External-SDCard. I tried doing a simple copy operation from the internal-SDCard to the External-SDCard and there was a prompt that came up (looks like it is from android OS and not from the application) which asks me to select the "root folder" of the External-SDCard.
Following that prompt, I get to the screen where I should click on the "External SDCard" icon on the left of the screen, but the when I do that, the application named "Documents" reports that it has stopped and then it sends me back to the paused copy operation in ES File Explorer and then that operations fails...
Anyone have any clue if this is supposed to work straight out of the "box"? Or do I need to download kernel patches or go modify platform.xml again like in 4.4.4 GPE?
Thanks!
r2d-two said:
I just uprgraded to the lollilop gpe OTA. Everything is working as normal, camera, Infrared, light, wifi, LTE radio, etc... I am also rooted.
However, ES File Explorer is still unable to modify the contents of the External-SDCard. I tried doing a simple copy operation from the internal-SDCard to the External-SDCard and there was a prompt that came up (looks like it is from android OS and not from the application) which asks me to select the "root folder" of the External-SDCard.
Following that prompt, I get to the screen where I should click on the "External SDCard" icon on the left of the screen, but the when I do that, the application named "Documents" reports that it has stopped and then it sends me back to the paused copy operation in ES File Explorer and then that operations fails...
Anyone have any clue if this is supposed to work straight out of the "box"? Or do I need to download kernel patches or go modify platform.xml again like in 4.4.4 GPE?
Thanks!
Click to expand...
Click to collapse
FAQ
Google Play Edition 5.0.1
SdCard
Q.)
The sdcard not being visible via PC is annoying.
Is there any fix for this yet?
A.)
Yes, here is a work-around
Install Terminal Emulator then type:
Code:
su
restorecon -FR /data/media/0
Some say the KK sdfix works also
clsA said:
Q.)
The sdcard not being visible via PC is annoying.
Is there any fix for this yet?
A.)
su
restorecon -FR /data/media/0
Click to expand...
Click to collapse
Thanks. Although the above says it resolves an issue with "The PC" not being able to see the sdcard, and my issue is with an android application (ES File Explorer) not being able to write to the sdcard, I still went ahead and ran the suggested command and although the command succeeded, the android application still can't write to the sdcard...
although it won't solve all your problems with writing to external SD card on the HTC One Lollipop, you can fix the crashing of the "Documents" app you described by making sure your micro SD card has a label (name): put the sd card in a sdcard reader in your PC/Laptop and give it a name.
Hi. Yes, you are correct I found out about the label being blank causing the crash and adding a label to the external sdcard partition fixed the crash in ES File Explorer. With the crash now gone i was able to grant ESFile Explorer write access to the entire external SDCard, and the app is now working flawlessly.
I also found this thread: https://code.google.com/p/android/issues/detail?id=67570#c4444
So, based on that thread's discussion, it looks like the app developers of any app that needs/wants write access to the external sdcard just need to change their applications to start using the new API, just like the ESFile Explorer guys did.
adb commands
Try running these adb commands one after the other
adb shell
su
restorecon -FR /data/media/0
Sent from my Viper Bitten M8

Categories

Resources