How to deal with a large JSON object on Android

前端 未结 6 1943
夕颜
夕颜 2020-12-17 16:37

I\'m making an Android app that runs a ASP.NET WebService. Webservice sends a JSON object and app parses the object and displays on the screen. In one case, JSON object is t

6条回答
  •  庸人自扰
    2020-12-17 17:01

    If data is large then try to save it in the database, then deal with it using SQLite. (but not recommended if its dynamic)

    To parse json object use gson or jackson. This will help reduce the memory consumption significantly as the json data being parsed partially. get Gson, jackson here https://sites.google.com/site/gson/gson-user-guide http://jackson.codehaus.org/

    A jackson example http://www.mkyong.com/java/jackson-streaming-api-to-read-and-write-json/

提交回复
热议问题