We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I am trying to save some data on the phone, for when the user closes the app. I thought the best way to do this is via XML (correct me if I am wrong).
So it works fine in Java mode, but when I switch to android it doesn't.
XML xml = loadXML("database.xml");
XML amount_tot_liter_xml = xml.getChild("amount_tot_liter");
println(amount_tot_liter_xml.getFloatContent());
The database.xml is inside the data folder. I can read data from the file. But I can't save data:
xml.removeChild(amount_tot_liter_xml);
amount_tot_liter_xml = xml.addChild("amount_tot_liter");
amount_tot_liter_xml.setFloatContent(amount_tot_liter);
saveXML(xml, "data/database.xml");
Answers
@toorgmot===
using the XML examples from docs (java mode) && modifying it for android (which has a lot of other ways && libs to do that) :: try this code