Android xml generate



i want develop an application that generate a xml like this:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>


macrì11_files\a.bmp macrì11_files\b.bmp macrì11_files\s.bmp macrì11_files\t.bmp macrì11_files\u.bmp macrì11_files\v.bmp macrì11_files\z.bmp macrì11_files\za.bmp macrì11_files\zr.bmp macrì11_files\zs.bmp macrì11_files\zu.bmp macrì11_files\zv.bmp macrì11_files\zz.bmp macrì11_files\zzg.bmp


i have used this code but i have some problems..


the code is this:



try {
FileOutputStream fos = new FileOutputStream("userData.xml");
FileOutputStream fileos= getApplicationContext().openFileOutput(xmlFile, Context.MODE_PRIVATE);
XmlSerializer xmlSerializer = Xml.newSerializer();
StringWriter writer = new StringWriter();
xmlSerializer.setOutput(writer);

xmlSerializer.startDocument("UTF-8", true);
xmlSerializer.startTag("xmml publish", "1.0");
xmlSerializer.startTag("xmedia _id", "f584ebd07e7542628e48da144ea9c412");
xmlSerializer.startTag("program _id", "8cbbcaae48cb44bebefeea29d87e8559~1");





xmlSerializer.endDocument();
xmlSerializer.flush();
String dataWrite = writer.toString();
fileos.write(dataWrite.getBytes());
fileos.close();
}


one of my problems is: how i can write this line? it is very long for one xmlSerializer.startTag


What i can use?


Very thanks


No comments:

Post a Comment