Tuesday, November 27, 2012

[android-developers] Data safety when writing important data to SD card

I am opening a file for append using BufferedWriter. Each time the app
is run, more data is added to the file. At first a made a little class
representing the file and gave it a write() method that would take a string
and send it out, then flush() the Writer. I was wondering when I should
close the file, or whether I really needed to. Will java close the file
for me when the app goes away? Right now, since the writes are few and
far between, I'm just opening and closing the file each time I write
a line to it, but that seems really awkward.

Thanks,

Toby

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate