2

I am building an app which needs to read and edit items from a .csv file.

I can place the .csv in the assets folder but would rather the ability to search for it in the external storage as it will change regularly.

A friend has given me this code for placing it in the assets folder, but I am relatively new to android and this code doesn't make sense to me and I cant get it to work.

public  ArrayList<String> Job     = new ArrayList<String>();

try {
    is = res.getAssets().open("Job.csv");
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    String line;

    while ((line = reader.readLine()) != null) 
        Job.add(line);

} catch (IOException ex) {
    // handle exception
} finally {
    try {
        is.close();
    } catch (IOException e) {
        // handle exception
    }
}
Chilledrat
  • 2,593
  • 3
  • 28
  • 38
Paul Bedford
  • 71
  • 2
  • 10

0 Answers0