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

拜拜、爱过 提交于 2019-12-23 04:33:28

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/5675380/how-to-store-parsed-xml-file-to-a-sqlite-database-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!