Skip to content

Instantly share code, notes, and snippets.

@dynoChris
Last active February 19, 2019 21:17
Show Gist options
  • Select an option

  • Save dynoChris/8ad0a3d5268dcd847814661c42c739da to your computer and use it in GitHub Desktop.

Select an option

Save dynoChris/8ad0a3d5268dcd847814661c42c739da to your computer and use it in GitHub Desktop.
How to read text file from Internal Storage in Android
String filePath = "/data/data/com.example.vadym.test1/filename.txt";
String all = "";
try {
BufferedReader br = new BufferedReader(new FileReader(filePath));
String strLine;
while ((strLine = br.readLine()) != null){
all = all + strLine;
}
Log.d(Utils.TAG, all);
} catch (IOException e) {
Log.e("notes_err", e.getLocalizedMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment