title: Android to write txt
body: <p>I try to code an app to write a file txt. 
  I found a lot of things on internet but not what i'm really looking for. </p>
  
  <pre><code>    String path=Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.txt";
      File file = new File(path);
      FileOutputStream is = new FileOutputStream(file);
      OutputStreamWriter osw = new OutputStreamWriter(is);
      Writer w = new BufferedWriter(osw);
      w.write("Je cree le fichier essai.txt");
      w.close();
  } catch (IOException e) {
      Log.i("Info", "Problem writing to the file statsTest.txt");
  }
  </code></pre>
  
  <p>Here is my code, i don't understand why the file is not created. I want to create the file on the storage of my phone and not as a  hidden file of the application (So not the mode context Private).</p>