Need help?

I'm available for remote short term contracting or consultancy work. Please check out my LinkedIn profile for more details on my experience.

Please feel free to use the form below to contact me.



Xml

The big question here is which technology to use, JSON vs XML. They both do a very good job, so what are the benefits of using one or the other? Well, I'm going to list the pros and cons of each, coming from a mobile point of view.

If's you're not too familiar with JSON and XML, I'll do a quick brief. They are basically used for defining and storing data (using meta data). This data can then be passed around - so when it travels from point A to B, the receiving end will know what each piece of information means (just to maintain a certain level of standardization).

jon | January 24, 2011 | Comments (2)

This article is going to walk you through some examples of how to use SAX to parse through XML documents, in an Android SDK environment.

There are actually 2 main ways of handling XML - SAX and DOM. The DOM parser loads the whole document into memory before it can work with it, which can be slow and uses up a lot more memory - the benefit is that you're not writing as much code. In this tutorial though, I'm going to be focusing on SAX, simply because it's the best for mobile devices, as they don't have a lot of memory. The beauty of SAX is that it goes through each element and attribute one at a time, and you can pick and choose which one you want added into memory, but you do need to write a lot more code (depending on what you want to do).

And before I forget, there is another called STaX, which is an XML pull parser, but I'm not going to get into that one.

jon | January 24, 2011 | Comments (23)