How to get right path files in android
<p>My code is following::</p>

<pre><code>Scanner sc = null;
try {
    sc = new Scanner(new File("assets/mainmenu/readSourceFile.txt"));
} catch (FileNotFoundException e1) {
    // TODO Auto-generated catch block
    System.out.println(e1.toString());
    e1.printStackTrace();
}
</code></pre>

<p>Then, logcat show exception <code>java.io.FileNotFoundException</code></p>

<p>How can I find my file? I tried </p>

<p><code>sc = new Scanner(new File("mainmenu/readSourceFile.txt"));</code></p>

<p>However, it's still throw <code>FilenotFoundException</code></p>

<p>My file is in folder assets/mainmenu/readSourceFile.txt</p>

<p>and I've try this::</p>

<pre><code>private InputStream is;
try {
        is = this.getResources().getAssets().open("mainmenu/readSourceFile.txt");
    } catch (IOException e) {
        e.toString();
    }
</code></pre>

<p>I use getAssets to access assets file in android. However, how can I suppose to read text file if I use <code>InputStream</code></p>
