Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my SD Card not writable (Android)?

In the emulator I can't seem to write to the attached SDCard. The following code always spits out the "can't write root" log message, but not the "can't read root" one.

File routesRoot = Environment.getExternalStorageDirectory();
if (!routesRoot.canWrite())
    Log.v(getClass().getSimpleName(), "can't write root");
if (!routesRoot.canRead())
    Log.v(getClass().getSimpleName(), "can't read root");

Ideas?

like image 247
Jeremy Logan Avatar asked Jan 07 '10 20:01

Jeremy Logan


People also ask

How can I make my SD card writable on mobile?

In our sync apps there is a new item in the app settings: “SD Card Write Access”. Selecting it opens a screen showing the current write access status. If write access is not possible, you can enable it by tapping “Enable Write Access” button. A system folder chooser dialog is displayed.

Why does my Android say can't write to SD card?

If you can't write to SD Card on Android, then there is a slight chance that SD Card protection has been enabled. This prevents you from writing any new data into the SD Card. To disable this feature, follow the steps below: Remove the SD Card which is currently in read only state from your device.

How do I make a SD card read only writable?

Check the physical write protection tab. If your memory card or memory card adapter is with a physical write protection tab, check whether the tab is in Unlock position. If not, slide it to such position. If it is in Unlock position and the memory card is still write-protected, you can try another solution.


1 Answers

Check, and then double check that you have the WRITE_EXTERNAL_STORAGE permission.

like image 121
moritz Avatar answered Oct 03 '22 18:10

moritz