简体   繁体   English

如何将解析的xml文件存储到Android中的sqlite数据库?

[英]how to store parsed xml file to a sqlite database in Android?

i am making a project in that i required synchronize data between server mysql data and local sqlite data... With the help oh php i have created mysql data XML file.... so now i know the parsing of xml data but how can i store it in sqlite(local) database ?? 我正在做一个项目,因为我需要在服务器mysql数据和本地sqlite数据之间同步数据...在php的帮助下,我创建了mysql数据XML文件。...现在我知道了xml数据的解析,但是如何我将其存储在sqlite(本地)数据库中?

Please help me i ll appreciate your help ... 请帮助我,我将感谢您的帮助...

So if you are parsing xml file you have key-value structure and maybe something else so create database with column named by parameters, for each row insert name of node or its own id and then values which you need, if you need to use only key-value maybe better way it'll be to put it into shared preferences. 因此,如果您要解析xml文件,则您具有键值结构,也许还有其他用途,因此请创建一个由参数命名的列的数据库,为每一行插入节点名称或它自己的ID,然后仅需要使用需要的值键值可能是将其放入共享首选项的更好方法。

Another option, jut save whole xml as a standard string(text) and then you can get it and parse it once again. 另一个选择是,将整个xml保存为标准字符串(文本),然后可以获取并再次解析它。

Everything depends on that what kind of structure you have. 一切都取决于您拥有什么样的结构。

HERE information about storing in database 这里有关存储在数据库中的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM