Skip to content Skip to sidebar Skip to footer

Continuously Save And Auto Increment String Values To File - Android

I have code which saves a String to a file. The problem is that the String is constantly changing (as they are sensor values) but the string is only saved once, then seems to delet

Solution 1:

new FileWriter("/sdcard/acvalues.txt", true)

http://developer.android.com/reference/java/io/FileWriter.html#FileWriter(java.io.File, boolean)

The parameter append determines whether or not the file is opened and appended to or just opened and overwritten.

Also: How to append text to an existing file in Java

Post a Comment for "Continuously Save And Auto Increment String Values To File - Android"