In my application (Android) I am creating a file. To this file, I add line by line after some situation. Then I send the data to the server in turn. When the whole transfer is OK, I delete the file as follows:
fos_kasowanie_pliku = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos_kasowanie_pliku.write("".getBytes());
fos_kasowanie_pliku.close();
Is it possible to delete only one line (first) after sending to the server? I read that I should rewrite the file without this line. Is there a better solution?
source
share