This document describes how to write and read strings from a file in Android. It shows code to write a string to a file using FileOutputStream, and then read the string back from the file using InputStream and BufferedReader. The write method opens a file for writing, writes the string bytes, and closes the stream. The read method opens the file as an input stream, reads it line by line into a StringBuilder, and returns the full string.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
13 views
How To Read Write String From A File in Android
This document describes how to write and read strings from a file in Android. It shows code to write a string to a file using FileOutputStream, and then read the string back from the file using InputStream and BufferedReader. The write method opens a file for writing, writes the string bytes, and closes the stream. The read method opens the file as an input stream, reads it line by line into a StringBuilder, and returns the full string.