简体   繁体   English

如何将解析的xml数据插入android中的sql lite数据库

[英]how to insert parsed xml data in to sql lite database in android

I have parsed xml data but I don't know how to insert it into a SQL Lite database and I don't know where I have to place the xml database file in Eclipse IDE folders. 我已经解析了xml数据,但是我不知道如何将其插入SQL Lite数据库中,也不知道将xml数据库文件放置在Eclipse IDE文件夹中的位置。

Kindly provide some example program with deployment descriptor. 请提供一些带有部署描述符的示例程序。

Thanks in advance 提前致谢

So far, I've only worked with creating (or updating) databases at runtime. 到目前为止,我只在运行时创建(或更新)数据库。 If you want to include a database in your actual apk, then you'll need to copy the file into the databases directory. 如果要在实际apk中包括数据库,则需要将文件复制到databases目录中。 If that sounds like what you're trying to do, take a look at this tutorial . 如果这听起来像您要尝试做的,请看一下本教程

If you just need to know how to work with a database in general, check out SQLite in the android documentation. 如果您只需要总体上了解如何使用数据库,请查看android文档中的SQLite Basically you want to make your own Helper class that extends SQLiteHelper, then create an actual Database class that makes use of the helper. 基本上,您想创建自己的扩展SQLiteHelper的Helper类,然后创建一个使用该Helper的实际Database类。

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

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