title: Android Studio write to .properties file
body: <p>I followed <a href="https://stackoverflow.com/questions/23792029/where-to-put-own-properties-file-in-an-android-project-created-with-android-stud">Where to put own properties file in an android project created with Android Studio?</a> and I got an InputStream which reads from my .properties file successfully. However, I can't write to that .properties file, as there is no similar method to <em>getBaseContext().getAssets().open ("app.properties")</em> which returns an OutputStream. I have also read <a href="https://stackoverflow.com/questions/21337732/java-properties-file-appending-new-values">Java Properties File appending new values</a> but this didn't seem to help me, my guess is my file name for the file writer is wrong but I also tried <em>"assets\userInfo.properties"</em> which also doesn't work.</p>
  
  <p>My .properties file is in src\main\assets\userInfo.properties</p>
  
  <pre><code>    Properties props = new Properties();
      InputStream inputStream = null;
      try{
          inputStream = getBaseContext().getAssets().open("userInfo.properties");
          props.load(inputStream);
  
          props.put("name", "smith");
          FileOutputStream output = new FileOutputStream("userInfo.properties"); //this line throws error
          props.store(output, "This is overwrite file");
  
          String name = props.getProperty("name");
          Log.d(TAG, "onCreate: PROPERTIES TEST NAME CHANGE: " + name);
  
      } catch (IOException e) {
          e.printStackTrace();
      } finally {
          try {
              inputStream.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>Current code throws this error:</p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: userInfo.properties (Read-only file system)</p>
  </blockquote>