Skip to content

Instantly share code, notes, and snippets.

@Gkemon
Created February 27, 2020 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gkemon/cf0d210389c4b084f1087da01d4a6b85 to your computer and use it in GitHub Desktop.
Save Gkemon/cf0d210389c4b084f1087da01d4a6b85 to your computer and use it in GitHub Desktop.
File file = new File(sdcard,"Android/file.txt");
StringBuilder text = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
text.append(line);
text.append('\n');
}
br.close();
return text.toString();
}
catch (IOException e) {
return e.getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment