Reading CSV file in resources folder android

前端 未结 5 1803
南方客
南方客 2021-01-04 19:39

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 er

5条回答
  •  不知归路
    2021-01-04 19:45

    you should put csv file in assets folder ..

    InputStreamReader is = new InputStreamReader(getAssets()
                            .open("filename.csv"));
    
    BufferedReader reader = new BufferedReader(is);
    reader.readLine();
    String line;
    while ((line = reader.readLine()) != null) {
                            
    }
    

提交回复
热议问题