XML issue on android
in
Android Processing
•
1 year ago
Hi everyone!
I'm reading an XML file using the following code:
P.S: I am using Processing 2.0a3 and developing for ASUS Transformer android tablet.
I'm reading an XML file using the following code:
- XML xmlFile;
- xmlFile = new XML(this, "/data/deneme.xml");
- // I also tried this line and it worked, too: // xmlFile =loadXML("/data/deneme.xml");
- XML [] messages = xmlFile.getChildren();
- print("TIMESTAMP= " + messages[0].getChild("timestamp").getContent());
Since it is written on processing help that XMLElement is deprecated, I used XML class. And I could read my xml file successfully using this code on
Standard processing mode. Whenever I tried
Android mode, and run the app on I got this error:
FATAL EXCEPTION: Animation Thread
java.lang.NoClassDefFoundError: processing.core.XML
at processing.android.test.game_xml_parser.game_xml_parser.setup(game_xml_parser.java:42)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:1020)
For android version I changed my code as follows:
Any suggestions why this happened and how to solve it, how to read an XML file on android?
Thanks,
java.lang.NoClassDefFoundError: processing.core.XML
at processing.android.test.game_xml_parser.game_xml_parser.setup(game_xml_parser.java:42)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:1020)
For android version I changed my code as follows:
- XML xmlFile;
- xmlFile = new XML(this, "/sdcard/test/deneme.xml");
- XML [] messages = xmlFile.getChildren();
- print("TIMESTAMP= " + messages[0].getChild("timestamp").getContent());
Any suggestions why this happened and how to solve it, how to read an XML file on android?
Thanks,
P.S: I am using Processing 2.0a3 and developing for ASUS Transformer android tablet.
1