Created
March 28, 2011 13:23
-
-
Save mstefanko/890435 to your computer and use it in GitHub Desktop.
read .txt file from android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
File f = new File(Environment.getExternalStorageDirectory()+"/myFile.txt"); | |
fileIS = new FileInputStream(f); | |
BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS)); | |
String readString = new String(); | |
//just reading each line and pass it on the debugger | |
while((readString = buf.readLine())!= null){ | |
Log.d("line: ", readString); | |
} | |
} catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
} catch (IOException e){ | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment