put your xml file in the resource folder and you can get the xml as input stream
InputStream raw = context.getApplicationContext().getAssets().open( "maths.xml");
you can parse this xml with another parser like SAX, Dom here is a small dom parsee code
Document dom = builder.parse(raw); Element root = dom.getDocumentElement() NodeList mathametician = root.getElementsByTagName("mathametician");
for (int i = 0; i <mathametician.getLength (); i ++)
and paste your data in db when you got the tag from xml
Krutik
source share