在Android中使用Volley从JSON下载大数据 [英] Download large data from JSON using Volley in android

查看:186
本文介绍了在Android中使用Volley从JSON下载大数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Android应用程序,我需要在其中使用Volley通过JSON解析来自数据库的数据.我的表中有 17,000+行,我需要通过JSON从表中获取所有行,并将其存储在SQLite中.下载后,用户可以修改所有行的字段.修改字段后.整个数据需要发送回服务器(像同步一样).

I am building an android application in which I need to parse the data from the Database through JSON using Volley. I have 17,000+ rows in the table, I need to fetch all the row from the table via JSON and I need to store it in SQLite. Once downloaded the user can modify the fields of all row. Once the fields have been modified. The whole data need to be sent back to the server(Like synchronize).

我的问题是,如果我尝试将大量数据下载到我的应用程序中.它崩溃了.有什么办法可以使此应用程序正常工作.还告诉我如何使用Volley解析服务器中的大量数据.

What my problem is, If I attempt to download this huge data to my app. It's getting crashed. Is there any way that I can do to make this app work. Also tell me how to parse huge data from the server using volley.

推荐答案

1-使用Gson解析数据并将其存储在ormlite数据库中.
2-修改数据库表后,应使用与服务器的同步适配器对表进行逐行同步.
3-使服务同步到服务器

1- Use Gson for parsing data and store in ormlite database.
2-After the modification to database tables you should be synchronize table row bye row using sync adapter to server.
3-Make Service for synchronize to server

这篇关于在Android中使用Volley从JSON下载大数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆