问题
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