android - Text file outputted via FileOutputStream -


how output text file see individual lines of text in logcat. file in res/raw/ directory , need basic on how this. have code required information provided fileoutputstream unsure how read in first place.

to read text file raw resource folder can use following snippet:

bufferedreader br = new bufferedreader(new inputstreamreader(getresources().openrawresource(your_resource_id))); string line = null; while ((line = br.readline()) != null) {     // whatever read line here     // write logcat e.g. use log.i("tag", line); } br.close(); 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -