Short question, When usb mass storage mode is enabled, I replace a image file in sdcard with another image file with the same name, Then disable usb mass storage mode, Enter gallery, The thumbnail is not updated, This issue exists even in Nexus S device, What's wrong? Thank you!
I think the media scanner service doesn't get the chance to rescan the image.
Try rebooting your phone. The media scanner runs on startup by default so it should rescan the SD card then.
Or.. you can just unmount then mount the SDCard. I think MediaScanner also runs when mounting a SDCard.
Related
is it possible for my app to do one or more of the following: read, write and detect data changes to phone storage while the phone is connected to the pc?
Note: The app is used on Android 4.1 and up
When SD card is connected to your pc your phone cannot read the sd card. So, naturally your app wont b able to read the SD card and detect changes as long as SD card is being read by your pc.
But once you disconnect the SD from your pc, you can detect any change in the SD card by comparing with the previous status of the sd card which u have to save for future comparisons!
Is it possible to send SD (Secure Digital) commands from Android app to SD card ?
Commands are read SD card, write to SD card etc (CMD18, CMD24).
The constraint is the phone should NOT be a rooted phone. With rooted phone we are able to send SD commands but not with unrooted phone. On attempting we get the error "permission denied".
Any help is greatly appreciated.
Thanks
It is not possible. The SD card hardware is abstracted away and mounted as a directory in the filesystem. Why would you want to send raw commands to the SD card anyway? Why not just read and write files on it?
I need to prevent a phone from having its firmware/ ROM updated. I already disabled lots of stuff like USB debugging, but people can still go to the recovery mode by pressing Vol+ and rebooting the device and then flash a new firmware from the SD card.
Can I somehow disable the SD card slot completely without physical changes to the device or writing my own firmware?
Can I somehow disable the SD card slot completely without physical changes to the device or writing my own firmware?
Fortunately, no.
My friend is testing my application which uses the SD card to store some settings. He has a Samsung Galaxy S2 but he just told me that he hasn't got an SD card in his device. It seems that the device created a folder in the phone's memory which simulates the existence of an SD card and that is where all app files that used the Sdcard are stored.
Is this a feature available for all Android devices? Should I consider the fact that there is no SD card on a device or should I not bother? Not sure if I should check for SD card availability in my app or not.
P.S. I've just noticed that the same goes for the emulator if I don't specify memory for the SD card.
You definitely should check for sdcard availability. On some devices it might work (as you said), but on some not, and you could get a FileNotFoundException.
So it's worth checking.
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.toString().equals(
state.toString())) {
//////then do your work here////////
}
another solution: https://stackoverflow.com/a/7429264/6451573
I am trying to add ringtones to the media/ringtones folder from my application. If the phone is connected via USB to a computer or mounted on my Mac, the ringtones do not show up in the SD Card, nor in the Ringtone settings.
But if I run the application with the USB unplugged, the ringtones appear ok. This is not a problem with Ringdroid which does the same thing.
Can someone please tell me what could be wrong.
Did you check the setting for usb mass storage? It should be off if you want to access the content of the sd card from the phone.
If you mount the SDCard on your Mac, your Phone canĀ“t acces it.
So, if you want to use the SDCard on your phone, it has to be mounted there (and nowhere else).