1
我想從存儲在SD卡中的XML讀取數據。 因此,我在我的代碼中使用了XmlResourceParser,但是如何將我的xml文件提供給XmlResourceParser? 有沒有其他方法可以做同樣的事情?如何從存儲插件的xml文件中讀取數據?
我想從存儲在SD卡中的XML讀取數據。 因此,我在我的代碼中使用了XmlResourceParser,但是如何將我的xml文件提供給XmlResourceParser? 有沒有其他方法可以做同樣的事情?如何從存儲插件的xml文件中讀取數據?
File myXmlFile = new File(Environment.getExternalStorageDirectory()+"/myfiles/myxml.xml");
And try to read data from File...
這將是更好的組合使用[Environment.getExternalStorageDirectory](http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29)與[getExternalStorageState] (http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState%28%29)而不是硬編碼值。 Thanx。 – devconsole 2012-02-22 14:08:59
Thanx。這對我來說有點用處。 – 2012-02-23 08:56:08