Managing text files Android
<p>I've got a little problem while managing .txt files on Android. I've found this <a href="http://www.sgoliver.net/blog/?p=2019" rel="nofollow">link</a> (it's in Spanish) that explains how to use text files on my Android device. </p>

<p>What I want to do, is create a text file using the intern memory of the device, as I don't want the user depend on a SD card, and a raw text file won't allow me to write on in, only read. So I want a text file that can append some information and, in a particular case, delete all the content in the text file and reset it.</p>

<p>I've written this code for the writing side:</p>

<pre><code>OutputStreamWriter fout = null;
try
{
    fout = new OutputStreamWriter(openFileOutput("measures.txt", Context.MODE_APPEND));
    fout.write(measure);
}
catch (Exception ex)
{
    Log.e("Files", "Error while opening to write file measures.txt");
}
finally
{
try 
{
    fout.close();
}
catch (IOException e) 
{
    // TODO Auto-generated catch block
        e.printStackTrace();
}
}
</code></pre>

<p>I guess this part opens the file "measure.txt" in the APPEND mode, or creates it in APPEND mode.</p>

<p>When I try to read from it:</p>

<pre><code>BufferedReader fin = null;
try
{
    fin = new BufferedReader(new InputStreamReader(context.openFileInput("medidas.txt")));
String line = fin.readLine();
// Some staff with this line
fin.close()
}
// catch staff
</code></pre>

<p>What I want to do is delete all the content in the text file before I close the file. The idea is store the information in another type of variable, and then, when I finish reading from file, reset the content.</p>

<p>How can I do that?</p>
