Android SDK: How to Parse a Read-Only XML File with Jdom
Parsing a read-only XML file with JDOM
I've previously described how to parse XML files using the XML Pull Parser, a streaming parser that's included with the Android SDK. I'm now going to describe an alternative approach using a parser called JDOM. JDOM is a third-party open-source, free solution that works well in both generic Java applications and in Android apps. You can download the binaries for JDOM, but I've included the JAR file. That is the library that you need to include in your application in the exercise files.
I'll get out of the browser and I'll go to my Exercise Files folder. Under the Assets folder, there's a subfolder called Software, and there's a file there called jdom-2.0.3.jar. You can use this or any later version. I'll copy the JAR file to the clipboard. Then I'll go back to Eclipse. Within Eclipse, I'll go to the libs folder of my new project, XMLJDOMParser. I'll go to that libs folder and I'll paste the file into place.
In addition to adding the JAR f...
Building Mobile Apps with Google Maps Android API v2115,953 Views
Connecting Android Apps to RESTful Web Services148,604 Views
Distributing Android Apps (2014)49,096 Views
Building a Note-Taking App for Android (2013)224,949 Views
Building Adaptive Android Apps with Fragments104,158 Views
Illustrator CC 2013 One-on-One: Fundamentals1,677,913 Views
PHP with MySQL Essential Training4,274,773 Views