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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -