sd.canWrite() always returns false
<p>I've set the following my android manifest:</p>

<pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
</code></pre>

<p>I've got the following in my activity:</p>

<pre><code>File sd = Environment.getExternalStorageDirectory();
boolean can_write = sd.canWrite();
</code></pre>

<p>sd returns /mnt/sdcard</p>

<p>I'm testing on my device (evo 3d) not the emulator. The sd card is mounted. It happens both when in charge only mode and when the usb cable isn't plugged in. Various pages on google and posts on stack show that exact same method to check if the sd card is writable so I must be missing something.</p>

<p><strong>UPDATE:</strong></p>

<p>I try the following code and it throws ioexception permission denied.</p>

<pre><code>    File TestFile = new File(sd + "/testfile.txt");
    try {
        boolean result = TestFile.createNewFile();
        if(result)
        {
            Log.i("tag","successfully created file");
        } else {
            Log.i("tag","failed to create file");
        }
    } catch (IOException e) {
        Log.e("tag",e.toString() + " " + TestFile);
        return false;
    }
</code></pre>

<p>I've formatted my sdcard, re-mounted it, and rebooted phone and still have the same error.</p>

<p><strong>UPDATE</strong></p>

<p>Apparently it's my own ignorance that caused it to fail. I had my permissions block in the wrong section of my manifest. Thanks again :) </p>
