title: Android - Reading a file using scanner, how to get to the file
body: <p>Hello i got a quite annoying problem
  i'd like to read text files similar to this</p>
  
  <pre><code>KEY
  0 1 2 3 4 5 6 7
  KEYEND
  </code></pre>
  
  <p>i tried to use scanner class, because it can return results as strings, decimals, whatever</p>
  
  <pre><code>   public static void LoadStuff(String Name) {
        Scanner reader = null;
        try {
           reader = new Scanner(new File(Name));
        } catch (Exception e) {
           Log.d("damn", "FAIL");
        }
           if(reader != null)
              Load(reader);
     }
  
  
  private static void Load(Scanner reader) {
        while (reader.hasNext()) {
           String result = reader.next();
           if (result == "KEY") {   // may be  result.equalsignorecase
              while (result != "KEYEND") {
                 int index = reader.nextInt();
                 Log.d("Index", String.valueOf(index));
              }
           }
        }
              reader.close();
     }
  </code></pre>
  
  <p>i cant do above, cause scanner cant find the file, parsing like "file.txt" doesnt work, tried also with path
  like this "res/data/file.txt" also doesnt work
  where should i put the file and how to get the directory to make it work
  thanks</p>