views:

93

answers:

1

Hi Team,

What is "deserializing Json" means, I had seen this term on the Web. I don't know the meaning od this particular term So, it would be great if anybody can explain me about What it means actually?

Thanks, david

+1  A: 

JSON is a method for representing data in a light-weight text-based form. For instance, an array of contacts in a phone book might be stored as follows;

{"contacts": [
  {"name": John, "phoneNumber":"+44000000000"},
  {"name": Jack, "phoneNumber":"+44000000001"}
]}

It's primary purpose is for use when transporting data to web-services. It seems to be especially popular with REST.

Serializing your data to JSON is the process of turning what might be an 'Array()' in your Java code into a text based representation of that data as shown above. De-Serializing JSON is that process in reverse. In the above example, Deserializing the JSON is the process of translating the text for the contactcs shown above into a data array in your Java application.

Fortunately, the Android SDK makes it easy to access a JSON library that will handle this process for you. http://developer.android.com/reference/org/json/JSONObject.html

And the following GSON library makes life even easier. http://sites.google.com/site/gson/gson-user-guide

There are a bunch of REST with Android examples on the web, they will almost definitely be able to help you out.

http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/

http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/

John Wordsworth