title: java.io.FileNotFoundException: /storage/sdcard/MyApp/questions.txt: open failed: EACCES (Permission denied)
body: <p>I have a problem when I try to save a file. First of all, it worked correctly when I try it on an older Eclipse, but I have to use new Eclipse so I export the project from the older Eclipse and import it on the new. Now it doesn't save and give me this excepction:</p>
  
  <pre><code>java.io.FileNotFoundException: /storage/sdcard/MyApp/questions.txt: open failed: EACCES (Permission denied)
  </code></pre>
  
  <p>I put the code I use to save (this code works on the older eclipse, in the new gives me the exception):</p>
  
  <pre><code>public void saveDates(boolean mainScreen)
  {
  
      String extr = Environment.getExternalStorageDirectory().toString();
      File mFolder = new File(extr + "/MyApp");
      if (!mFolder.exists()) 
      {
          mFolder.mkdir();
      }
      String strF = mFolder.getAbsolutePath();
      File mSubFolder = new File(strF /*+ "/MyApp-SubFolder"*/);
      if (!mSubFolder.exists()) 
      {
          mSubFolder.mkdir();
      }
  
      //Nombre del fichero
      String s = "questions.txt";
  
      BufferedWriter out;      
      try 
      {
          FileWriter fileWriter = new  FileWriter(mSubFolder.getAbsolutePath() + "/" + s, false);
          out = new BufferedWriter(fileWriter);
  
          out.write(indexAnswer + ";");
          out.write("\r\n");
          out.write(finished + ";");
          out.write("\r\n");
          out.write(directricesGenerales + ";");
          out.write("\r\n");
          out.write(politicaAmbiental + ";");
          out.write("\r\n");
          out.write(planificacion + ";");
          out.write("\r\n");
          out.write(implementacion + ";");
          out.write("\r\n");
          out.write(verificacion + ";");
          out.write("\r\n");
          out.write(revision + ";");
          out.write("\r\n");
          out.write(definicionProyecto + ";");
          out.write("\r\n");
          out.write(analisisAmbiental + ";");
          out.write("\r\n");
          out.write(desarrollo + ";");
          out.write("\r\n");
          out.write(disenyoDetalle + ";");
          out.write("\r\n");
          out.write(planAccion + ";");
          out.write("\r\n");
          out.write(evaluacionContinua + ";");
          out.write("\r\n");
          out.close();
      }
      catch (FileNotFoundException e) 
      {
          e.printStackTrace();
      }
      catch (IOException e) 
      {
          e.printStackTrace();
      }
  
      Toast.makeText(getApplicationContext(), "Datos guardados.", Toast.LENGTH_LONG).show();
  
      if(mainScreen)
      {
          // Cerrar la ventana de test y volver a la de inicio
          Intent intent = new Intent();
  
          intent.setClass(questions.this, MainActivity.class);
          startActivity(intent);
          finish();
      }
  }
  </code></pre>
  
  <p>And my manifest file:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.XXX"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="22" /&gt;
  
  
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  
      &lt;activity
          android:name="com.example.ecotoolin.principal"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt; 
          &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.MAIN" /&gt;
  
             &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
  
  
      &lt;activity
          android:name="com.example.ecotoolin.questions"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt; 
      &lt;/activity&gt;
  
      &lt;activity
          android:name="com.example.ecotoolin.Chart"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt; 
      &lt;/activity&gt;
  
      &lt;activity
          android:name="com.example.ecotoolin.MainActivity"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="com.example.ecotoolin.reload"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt; 
      &lt;/activity&gt;
  
  
  
      &lt;activity
          android:name="com.example.ecotoolin.sendMail"
          android:label="@string/app_name" 
          android:screenOrientation="portrait" 
          android:configChanges="keyboardHidden|orientation|screenSize"&gt; 
      &lt;/activity&gt;
  &lt;/application&gt;
  
   &lt;uses-permission 
      android:name="android.permission.INTERNET"&gt;
  &lt;/uses-permission&gt;
  &lt;uses-permission 
      android:name="android.permission.ACCESS_NETWORK_STATE" &gt; 
  &lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;    
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And an image of my emulator details:</p>
  
  <p><img src="https://i.stack.imgur.com/gpoNS.png" alt="enter image description here"></p>
  
  <p>Can anyone help me? Iwant to save the file like I do it in the older version, I don't know why doesn't work.</p>