json - how to parse array inside object through gson in android -
i want parse array inside object through gson.. example
{ 'title': 'java puzzlers: traps, pitfalls, , corner cases', 'isbn': '032133678x', 'authors':[ { 'id': 1, 'name': 'joshua bloch' }, { 'id': 2, 'name': 'neal gafter' } ] }
i able parse object i.e. title, isbn , got value don't know how value of authors? please ,i using json parsing through gson in android..
arraylist<authors> lauthors = new arraylist<authors>(); list<authors> list = new gson().fromjson(json, lauthors.getclass()); (object : list) { system.out.println(a); }
this give values in class author's object.
public class author{ int id; string name; //getter setter here }
hope helps.
Comments
Post a Comment