Just post the method in the project
/** * Read out the city list file*/ private String readCityFile() { File file02 = new File(path_xinfu, "/cityList.json"); FileInputStream is = null; StringBuilder stringBuilder = null; try { if (file02.length() != 0) { /** * Only if the file has contents should you read the file*/ is = new FileInputStream(file02); InputStreamReader streamReader = new InputStreamReader(is); BufferedReader reader = new BufferedReader(streamReader); String line; stringBuilder = new StringBuilder(); while ((line = reader.readLine()) != null) { // stringBuilder.append(line); stringBuilder.append(line); } reader.close(); is.close(); } else { mLoadingLayout.setStatus(LoadingLayout.Empty); } } catch (Exception e) { e.printStackTrace(); } return String.valueOf(stringBuilder); }The above method of reading the file content as a string string in Java is all the content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.