Read xml file from Android Asset folder

irmatan

New Member
I'm trying to read the same file "xmlfile.xml" from the assets folder and also another copy from the SD card sdcard/download/.I can Read from SD Card:
  • unfile Return True
  • Esite Return True
I can't not Read from Assets folder:
  • unfile Return False
  • Esite Return False
This code il NOT Working\[code\] File source = new File("file:///android_asset/xmlfile.xml"); boolean unfile = source.isFile(); boolean Esiste = source.exists(); try { // todo } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }\[/code\]This code il Working\[code\] File source = new File("/sdcard/" + "download" + "/" + "xmlfile.xml"); boolean unfile = source.isFile(); boolean Esiste = source.exists(); try { // todo } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }\[/code\]someone can explain me how can I read the file from the Assets folder.thanksmarco
 
Back
Top