Export SQLite database into XML file

♀尐吖头ヾ 提交于 2020-01-14 05:56:08

问题


How can I export data from database and store it in an XML file?

My database schema looks like this:

private static final int DATABASE_VERSION = 4;
public static final String DATABASE_NAME = "instruments.db";
private static final String TABLE_NAME = "instrument_table";
public static final String COL_1 = "ID";
public static final String COL_2 = "NAME";
public static final String COL_3 = "LOCATION";
public static final String COL_4 = "INFORMATION";
public static final String COL_5 = "PHOTO";

Any suggestions on how to achieve this?


回答1:


Have a look at this post and this tutorial to get you started. You will need to use XmlSerializer to create the XML file. This post should also help you out.



来源:https://stackoverflow.com/questions/38357214/export-sqlite-database-into-xml-file

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