I have a large json page which contains url:http://akhilmadanan.tk/Akhil/database.php.
While i am parsing this page using normal json parsing method it shows “OutOfMemoryError”. For this i heard about GSON. Please any body help me get how to read the datas from below page using GSON.
any tutorial?
I have a large json page which contains url:http://akhilmadanan.tk/Akhil/database.php. While i am parsing this
Share
You can definitely go to links provided by others which are helpful
For brief you can add GSON library in your lib folder.
and use like this.
To get object from json
To convert to json
I run your code and there are 3010 items of object
Now make a model equivalent to above name like
remember to add one list of same class type like
and generate getters and setters of that Customer class;
after this
parse your data like this
CustomerModel customerModel=gson.fromJson(json,Customer.class);
you get all your data in customerModel;
To access data just use list of that class.