Tour tech pointers and tutorials. Focused on web services for the travel industry.

Wednesday, December 14, 2011

XML Data Binding for Java on Android using JiBX

JiBX is an excellent tool for binding XML data to Java objects on the Android platform.

- JiBX is fast!- JiBX has a small footprint (it will add only 60KB to your .apk)- JiBX uses the Android XMLPull parser by default- It's easy to use!

We all appreciate the advantages of being able to use java classes to do data manipulation. person.setFirstName("Don"); is much easier then messy DOM manipulation: document.getElementsByTagName("first").item(0).appendChild(document.createTextNode("Don"));

This program takes the First and Last Name entered, plugs them into a java data object, marshals the object to xml, and unmarshals the xml back to a data object and extracts the data from it. I made this program very simple, of course you would not do this kind of processing in the main thread.

Run your application by right clicking the project name and selecting 'Debug as' -> 'Android Application'. Enter your first and last name and click the button on the top.

First, I think the author did a great job to make JiBX work on Android, however, JiBX was originally designed for desktop and server side development, hence it's too heavy-weight for resource limited mobile device like Android. I would recommend a light-weight xml binding framework tailed for Android platfrom, the library is called Nano, the jar is less than 70K, performance comparable to Android native parser like SAX and Xml Pull, it supports both XML and Json binding, it uses annotation driven binding, similar to JAXB, also it provides a binding compiler to auto-generate bindable class from xml schema, you may have a try if you are interested in it.https://github.com/bulldog2011/nano

Hi, I am Emi lives in Chennai. I am technology freak. I did Android mobile application development course in Chennai at reputed training institutes, this is very usful for me to make a bright carrer in IT industry. So If you looking for best Android Training Institutes in Chennai please visit fita academy. Android Training in Chennai

Hi I am Emi from Chennai. Thanks for sharing the informative post about Java technology. It’s really useful for me to know more about this technology. Recently I did Java Training in Chennai at a leading Java Training Institutes in Chennai.

Thanks for your article on Android technology. Android is an open source platform that allows developers to create stunning website loaded with various advanced features and functionalities. Best Android Training institute in Chennai

Excellent post!!! Java is most popular and efficient programming language available in the market today. It helps developers to create stunning desktop/web applications loaded with stunning functionalities. Best JAVA Training in Chennai

Hadoop is especially used for Big Data maintenance. It uses Hadoop distributed file system . Its operating system is in cross platform. Its framework mostly written in java programming language. The other languages which are used by hadoop framework are c, c++ (c with classes) and sometimes in shell scripting.Thank you..!!regards,Hadoop Training in Chennai | hadoop training in adyar

Wonderful post!!Java is written once and used anywhere, means general it is platform independent so it can run any platform like in android, linux, etc..,.It Is general purpose programming language. It was Origin by two programming language c and c++(c with classes).Thank you for sharing your article.Regards,java training in vadapalani | JAVA Training in Chennai

I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts. I want to share some information, we provide outsource data entry services in all over the world. Back Office Services

You're really great especially for the high gauge and results-arranged help. I won't reevaluate to grasp your blog passage to any individual who needs additionally, needs support about this zone.Education | Article Submission sites | Technology