save and load from sdcard shows empty file
<p>I have a layout where I have an Edit Text field where I enter my data.
I have 2 buttons.Save and Plot.</p>

<p>When I press save I want to save the data (in xls format) from edittext field and the current date in sd card.</p>

<p>When I press the plot ,I want to plot them.</p>

<p>To save data:</p>

<pre><code>case R.id.savebtn:
            savefunc();
            break;
...
public void savefunc(){
        //saving 

         File sdCard = Environment.getExternalStorageDirectory();
         File directory = new File (sdCard, "MyFiles");
         directory.mkdirs();
         File file = new File(directory, filename);
         try {
             FileOutputStream fOut = new FileOutputStream(file);
             DataOutputStream os = new DataOutputStream(fOut);
         os.writeUTF(thedata);
         os.writeUTF(mydate);
         os.close();
         } catch (FileNotFoundException e) {
         // handle exception
         } catch (IOException e) {
         // handle exception
           }
    }
</code></pre>

<p>For reading:</p>

<pre><code>public void readfunc(){

        File sdCard = Environment.getExternalStorageDirectory();
        File directory = new File (sdCard, "MyFiles");
        File file = new File(directory, filename);
        try{
            FileInputStream fIn = new FileInputStream(file);
            DataInputStream is = new DataInputStream(fIn);
            String name = is.readUTF();
            String content = is.readUTF();
            is.close();
            } catch (FileNotFoundException e) {
                // handle exception
             } catch (IOException e) {
             // handle exception
               }

    }
</code></pre>

<p>and :</p>

<pre><code> case R.id.savebtn:
  savefunc();
    break;
case R.id.graphicsbtn:
    readfunc();          

    ...
</code></pre>

<p>But the xls file asks me format , I choose UTF8 and it is empty.</p>

<p>If I leave it shows chinese characters.</p>

<p>I am not sure about the "reading" part of the code.</p>
