android reading from a text file
<p>I have a java class where it reads some data from a text file using a buffered reader and returns that data as a hash map:</p>

<pre><code>import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;

public class FrequencyLoader {

     public FrequencyLoader() throws FileNotFoundException {
        }

        public HashMap&lt;String, Double&gt; loadUnigramFrequencies() throws FileNotFoundException, IOException {
            HashMap&lt;String, Double&gt; unigramFrequencies = new HashMap&lt;String, Double&gt;();
            String line;
            String[] splittedLine;

            BufferedReader bf = new BufferedReader(new FileReader("unigramFrequencies.txt"));

            while ((line = bf.readLine()) != null) {
                splittedLine = line.split("\\s");


                unigramFrequencies.put(splittedLine[0].trim(), Double.parseDouble(splittedLine[1].trim()));
            }

            return unigramFrequencies;
        }
}
</code></pre>

<p>I want to use that in my android application but when I create an instance of this class and try to execute the loadUnigramFrequencies() funtion in the android Activity class I am getting an error that the application has stopped unexpectedly. I am trying to run it on Samsung Galaxy S2. Should the file be placed somewhere in the android project rather than on the disk? if yes then where?</p>
