Sarit Adhikari Sarit Adhikari - 8 months ago 81
Android Question

Reading CSV file in resources folder android

I am developing an android app in netbeans. I am trying to read CSV file using opencsv. When I put the file in resources folder and try to read it from there, there's an error while building saying invalid resource directory. Where should I store csv file so that it can be read each time the app starts?


you should put csv file in assets folder ..

InputStreamReader is = new InputStreamReader(getAssets()

                BufferedReader reader = new BufferedReader(is);
                String line;
                while ((line = reader.readLine()) != null) {