So first what is JSON, there are good links out there already:
1. JSON in Java
In short, an XML Doc
{
"name": "Horror Book"
"author":"Smith"
}
Where we used JSON and Why?
First, the project required us to exchange information between a client on a mobile phone emulator and a web server. XML is the first obvious choice or just a series of comma separated values, etc. We chose JSON since there were good libraries to place information in a structured manner in JSON and to read it on the other side. No need of using some XML parser and stuff. Space saved for closing tags, etc.
Second, the application was designed such that receipt of purchase would be stored in a 2D Barcode and sent to the mobile phone emulator. As per the project, in the real world, the user would take the barcode to the retailer as a proof of receipt. There were other security related use of 2D Barcodes as well. Again, 2D barcodes cannot save a lot of information. JSON and its libraries would provide us a very compact way to store info in the barcode and read it back.
Today, I also noticed an article discussing other uses of JSON in mobile apps here.
See here for using JSON in J2ME
No comments:
Post a Comment