FileOutputStream fos = null;
String FILENAME = "Your File Name";
fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
// write your bytes using fos
fos.write(Bytes to be saved);
fos.close();
// to read a file
FileInputStream fis = null;
fis = youractivity.openFileInput(FILENAME);
StringBuilder builer = new StringBuilder("");
DataInputStream dis = new DataInputStream(fis);
String line = null;
while((line=dis.readLine()) != null)
{
builer.append(line);
}
dis.close();
fis.close();
solved How to store a data continuously in a file? [closed]