从读取SD卡的.xml文件 [英] Reading an .xml file from sdcard

查看:428
本文介绍了从读取SD卡的.xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有存储在名为bkup.xml一个XML文件中的内部SD卡/sdcard/bkup.xml。

I have one xml file called bkup.xml stored inside sdcard "/sdcard/bkup.xml".

有关创建bkup.xml我已经使用xmlSerialization。

For creating bkup.xml I have used xmlSerialization.

我想从bkup.xml文件中检索数据。

I want to retrieve data from that bkup.xml file.

我看过很多例子,但几乎大部分都是使用资源文件,并使用URL作为一种资源。但是,没有人有例如给予SD卡文件的路径。

I have seen many examples but almost most of them are using resource file and using URL as a resource. But no one have example of giving a path of sdcard file.

我不知道如何从文件中读取数据,并分析它。

I don't know how to fetch data from that file and parse it.

在此先感谢。

任何建议将AP preciated

Any suggestion will be appreciated

推荐答案

这里 是一个完整的例子有来源。你只拿到了文件

 File file = new File(Environment.getExternalStorageDirectory()
                    + "your_path/your_xml.xml");

然后做进一步的处理。

Then do the further processing.

更新

如果您需要榜样不同的类型 XML 的解析器可以从的 完整例子/开源/库/ X-机器人/相对=nofollow> 此处

If you need example for different types of XML Parsers you can download complete example from here.

这篇关于从读取SD卡的.xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆