title: Writing data to a public text file in Android
body: <p>I need to write some data into a text file to be read from standard text editor applications. In my app (running on <strong>Android 7.0</strong>) compiled with <code>targetSdkVersion 27</code> I'm doing this trough this method, that works (or at least it seems to work since I got no exeptions):</p>
  
  <pre><code>private void storeLocation(Location location) {
      try {
          FileOutputStream outputStreamWriter;
  
          outputStreamWriter = this.openFileOutput(logPath.getPath(), Context.MODE_APPEND);
  
          outputStreamWriter.write(("LAT: " + location.getLatitude() + "\n").getBytes());
          outputStreamWriter.write(("LON: " + location.getLongitude() + "\n").getBytes());
          outputStreamWriter.close();
      }
      catch (Throwable e) {
          Log.e("Exception", "File write failed: " + e.getMessage());
      }
  }
  </code></pre>
  
  <p>Variable <code>logPath</code> is defined in this way in application <code>onCreate()</code> event handler:</p>
  
  <pre><code>File logPath = new File("VIPER_" + getCurrentDateTime() + "_" + UUID.randomUUID().toString() + ".log");
  </code></pre>
  
  <p>I tought to find this file inside application private data folder but it's not here (maybe it's deleted after application closing?).</p>
  
  <p>If I try to specify a different folder (like public downloads folder etc.) I got all sort of exceptions like <code>file not found</code>, <code>read only filesystem</code>, <code>presence of / character in path</code> etc.</p>
  
  <p>There's a (simple) way to allow an application without having to deal with a <code>FileProvider</code> implementation?</p>