title: How can I use fileReader to read text file data in Android Studios?
body: <p>I have a fileReader that works in Java but the same method doesn't work for Android Studios. The code I use in Eclipse to read my text file data is:</p>
  
  <pre><code>public void addTextFilesToCardsArrayList(String fileName) throws IOException{
          FileReader freader =  new FileReader(fileName);
          BufferedReader reader = new BufferedReader(freader);
          String line = null;
          try {
              while ((line = reader.readLine()) != null) {        //Read a file line by line
                   String[] split = line.split(",");              //Parse the line in to usable fragments
                   int cardNumber = Integer.parseInt(split[0]);
                   String cardId = split[1];
                   int apc = Integer.parseInt(split[2]);
                   int hp = Integer.parseInt(split[3]);
                   String type = split[4];
  
                   Card card = new Card(cardNumber, cardId, apc, hp, type);
                   cards.add(card);
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>I placed a text file called "cards.txt" in the asset folder that I created in "main" directory. Normally I pass it in as a paramter like "cards.txt" in Eclipse. How do I get it working in Android Studios fileReader?</p>
  
  <p>I've seen  InputStream is = getAssets().open("file.txt"); being used but I've liked to keep my method mostly the same without rewriting my fileReader code.</p>