This is my code for creating a multi-line text file:
FileOutputStream fos=null; OutputStreamWriter osw; try { fos = openFileOutput("login.txt",Context.MODE_PRIVATE); fos.write(("Line One").getBytes()); osw = new OutputStreamWriter(fos); osw.append("\r\n"); osw.append("Line Two"); osw.flush(); osw.close(); fos.flush(); fos.close(); } catch (Exception e) {}
source share