开发者

android: dump data from local xml file to SQLite database

How can I copy my data from xyz.xml in my assets dir to my sqllite db during development开发者_开发技巧 in android platform


Something like this..

InputStream is;
Document dom = null;
is = getAssets().open("main.xml");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
dom = builder.parse(is);
Element root = dom.getDocumentElement();


You can use:

XMLPullParser xpp = getResources().getXml(R.xml.id);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜