如何解析的XML文件存储在Android的SQLite数据库? [英] how to store parsed xml file to a sqlite database in Android?

查看:423
本文介绍了如何解析的XML文件存储在Android的SQLite数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出的一个项目需要我同步服务器MySQL数据和地方数据的SQLite之间的数据...
借助哦PHP时我已创建MySQL数据的XML文件....所以,现在我知道XML数据的分析,但我怎样才能将其存储在sqlite的(本地)数据库?

请帮助我,我美联社当地雇员preciate你的帮助......


解决方案

因此​​,如果您解析XML文件,你有钥匙,价值结构,也许别的东西所以创建一个由参数指定的列数据库,节点的每个行插入名称你所需要的,如果你需要使用唯一的关键值或自己的ID,然后可能值更好的方法这将是把它放到共享preferences。

另一种选择,突出部分整个XML保存为标准字符串(文本),然后你可以得到它,并再次解析它。

一切都取决于你有什么样的结构。

这里有关数据库

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 ??

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.

Another option, jut save whole xml as a standard string(text) and then you can get it and parse it once again.

Everything depends on that what kind of structure you have.

HERE information about storing in database

这篇关于如何解析的XML文件存储在Android的SQLite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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