Hi All,

I am writing an application that will create a textfile in the /sdcard
or /data directory and write messages to the textfile.Each time I want
to append the messages and not overwrite the file.

I used the following code:

  public void writeAlert(String message){
         FileWriter f;
          try {
                f = new FileWriter("/sdcard/alert.txt");
                f.write(message);
        f.flush();
        f.close();
        } catch (IOException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
        }
}

But there is no text file created. Any idea what's the problem with my
code? Is this the correct way or is there any other way to create and
write to a textfile?

Thanks In Advance,
Perumal

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to