title: How can I create an external shared pref/config file for my Android application?
body: <p>I am looking for a way to store configuration setting on an external file on the sd card. The app must look into this external file and then retrieve some kind of settings. At the moment i am trying to get it to look into a file and get a name. I know you can store things in shared preferences but they are internally accessed. </p>
  
  <p>Anybody know an external way? Thanks</p>
  
  <p>The idea is to have a simple text file or xml file on the sd card. So when a configuration needs changing it is done thru that file?</p>
  
  <p>EDIT</p>
  
  <pre><code>File sdcard = Environment.getExternalStorageDirectory();
      File file = new File(sdcard,"/Config.txt");
      StringBuilder text = new StringBuilder();
      try {
          BufferedReader br = new BufferedReader(new FileReader(file));
          String line="";
          int c;
          while ((c = br.read()) != -1) {
              line+=(char)c;
              if(String.valueOf(c) == ";" &amp; line =="name;"){
                  String name ="";
              }
          }
      }
  </code></pre>
  
  <p>I have attempted to read in a config.txt file and to separate each value with a ;
  But i cant seem to understand exactly how i am going to attach what comes after name; to the variable String name. </p>
  
  <p>the config.txt file has the following:</p>
  
  <p>name;fred
  somethingelse;test</p>
  
  <p>The program should know when it has got to name and then set the name variable to fred??</p>