0

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?

yennsarah
  • 5,467
  • 2
  • 27
  • 48
Himanshu
  • 73
  • 1
  • 11
  • Possible duplicate of [this question](http://stackoverflow.com/questions/2585934/exporting-a-sqlite-database-to-an-xml-file-in-android) – chengsam Jul 13 '16 at 17:24
  • I have check that one but none of the link are working in verified answer of that question and rest are literally not to the point. – Himanshu Jul 13 '16 at 17:32

1 Answers1

0

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.

Community
  • 1
  • 1
Razor
  • 1,778
  • 4
  • 19
  • 36