title: Reading From a File saved in the /res or /asset folder? Android
body: <p>I am trying to read a text file and save each line of text into an ArrayList. I have tried various methods, including FileInputStream and BufferedReader. Here is the code that currently gets me the closest to what I am trying to do</p>
  
  <pre><code>try {       
      InputStream is = getResources().openRawResource(R.File.txt);        
      BufferedReader bufferedReader = new BufferedReader(new FileReader("File.txt"));
      String line;
  
      while((line = bufferedReader.readLine()) != null)
      {
          allText.add(line);
      }
      bufferedReader.close();
  }
  catch(IOException e)
  {
  
  }
  </code></pre>
  
  <p><code>allText</code> is an ArrayList previously instantiated. Right now the file is saved in /res and I get an "invalid resource directory warning". I would like to know where to save the file properly and how to read from it. </p>