2

What does "deserializing Json" mean, I have seen this term on the Web. I don't know the meaning of this particular term. It would be great if anybody could explain to me what it means.

1 Answer 1

18

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/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.