{
"data": [
{
"name": "acac",
"id": "00000"
},
{
"name": "adcd",
"id": "1111111"
}
],
"paging": {
"next": "https://graph.facebook.com/00000000/friends?...."
}
}
I am trying to list facebook friends list in my android app.I am getting friends list as json data.now my question is how to create java class from json data.I already created two classes for “data” and “paging”.I am stucked in how to use both of this class while parsing.
Thanks in advance
You can follow this tutorial to parse JSON string into native domain Java objects using GSON here:
http://java.sg/parsing-a-json-string-into-an-object-with-gson-easily/
Google GSON will handle all the pipeline codes for parsing JSON string into Java objects for you.
You can then create an object called Facebook which has an array of “Data” objects, and a “Paging” object.