title: fopen failed while writing into an external SDcard in Android native code
body: <p>When I am trying to write into external SDcard from android native code, I am getting permission denied in fopen. </p>
  
  <pre><code>mFp = fopen("/storage/extSdCard/Output/test.txt", "wb");
  </code></pre>
  
  <p>if I print strerror(errno) it gives -></p>
  
  <pre><code>fopen(/storage/extSdCard/Output/test.txt) failed: Permission denied
  </code></pre>
  
  <p>Please note that I have also given the permissions in my Application manifest :</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;  
  ....
  &lt;/manifest&gt;
  </code></pre>
  
  <p>and also :</p>
  
  <pre><code>String state = Environment.getExternalStorageState();
          if (Environment.MEDIA_MOUNTED.equals(state)) {
              return true;
          }
  </code></pre>
  
  <p>is returing true.</p>