using big files from res/raw
<p>I am trying to develop dictionary application which uses source files from res/raw.
It works when i use a smaller file, but not with a file that I have to use which is cca 5mb.</p>

<p>I decided to split it in parts and to use it this way because it appears that android has some file size limits for assets folder(1mb?).
But it doesnt work this way, it loads something in the program but not all the dictionary files. What seems to be the problem? Am I going in a completely wrong way about this?</p>

<pre><code>    private void loadWords() throws IOException {
        final Resources resources = mHelperContext.getResources();
        InputStream inputStream = resources.openRawResource(R.raw.definitions1);
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
        ucitaj(reader);

        InputStream inputStream2 = resources.openRawResource(R.raw.definitions2);
        BufferedReader reader2 = new BufferedReader(new InputStreamReader(inputStream2));
        ucitaj(reader2);

        InputStream inputStream3 = resources.openRawResource(R.raw.definitions3);
        BufferedReader reader3 = new BufferedReader(new InputStreamReader(inputStream3));
        ucitaj(reader3);

        InputStream inputStream4 = resources.openRawResource(R.raw.definitions4);
        BufferedReader reader4 = new BufferedReader(new InputStreamReader(inputStream4));
        ucitaj(reader4);

        InputStream inputStream5 = resources.openRawResource(R.raw.definitions5);
        BufferedReader reader5 = new BufferedReader(new InputStreamReader(inputStream5));
        ucitaj(reader5);

        InputStream inputStream6 = resources.openRawResource(R.raw.definitions6);
        BufferedReader reader6 = new BufferedReader(new InputStreamReader(inputStream6));
        ucitaj(reader6);
</code></pre>

<p>-- </p>

<pre><code>  private void ucitaj(BufferedReader reader) throws IOException {
        Log.d(TAG, "Loading words...");
        try {
            String line;
            while ((line = reader.readLine()) != null) {
                String[] strings = TextUtils.split(line, " -- ");
                if (strings.length &lt; 2) continue;
                long id = addWord(strings[0].trim(), strings[1].trim());
                if (id &lt; 0) {
                    Log.e(TAG, "unable to add word: " + strings[0].trim());
                }
            }
        } finally {
            reader.close();
        }
        Log.d(TAG, "DONE loading words.");
    }
</code></pre>
