November 19th, 2011, 03:37 PM
|
#3 (permalink)
|
|
Premium Member
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
|
Wrap the the FileOutputStream in an OutputStreamWriter. In general in Java, use Reader and Writer when dealing with text. Use InputStream and OutputStream only when dealing with binary data.
Code:
Writer wtr
= new OutputStreamWriter(
openFileOutput("testerfile.xml", Context.MODE_PRIVATE),
"UTF-8"
);
wtr.write("<?xml version='1.0' encoding='UTF-8'?>\n");
wtr.write(FullDescription);
wtr.close();
In regards to where the file goes, you should find the file at the following path:
/data/data/ app package/files/testerfile.xml
where app package is the package specified in your AndroidManifest.xml.
|
|
|
Last edited by jiminaus; November 19th, 2011 at 03:56 PM.
|
|