Every 10 lines in the file, the data structure is repeated, for example:
name1 name2 name3 ..... name10 name1 name2 name3 ..... name10 It is necessary to read the data in the model. I read like this:
File sdcard = Environment.getExternalStorageDirectory(); File file = new File(sdcard,"file.txt"); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { Data data= new Data(); String[] strings = TextUtils.split(line, " "); for(int i=0;i<11;i++){ myApplication.setDataValue1(strings[0].trim); myApplication.setDataValue2(strings[1].trim); myApplication.setDataValue3(strings[2].trim); ... } data.setData(myApplication.getDataValue); } br.close(); } catch (IOException e) { } But in this way it is not at all read what I would like. Where is the mistake?