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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -