开发者

android: dump data from local xml file to SQLite database

开发者 https://www.devze.com 2023-01-11 06:19 出处:网络
How can I copy my data from xyz.xml in my assets dir to my sqllite db during development开发者_开发技巧 in android platformSomething like this..

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

精彩评论

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