android - (Andriod Firefox addon) need to read from Data.txt -


i beginner on android firefox addon. have difficulty read file.txt path (/mnt/sdcard/) . know possible desktop don't know if possible android or not. spend 2 days, doesn't work. here code bootstrap.js

 var file = components.classes["@mozilla.org/file/directory_service;1"].                getservice(components.interfaces.nsiproperties)              .get("/mnt/sdcard/", components.interfaces.nsifile);    file.append("newdir");   if( !file.exists() || !file.isdirectory() ) {     file.create(components.interfaces.nsifile.directory_type, 0777);   }   this.log_file=file.path+"/data.txt";  var = components.classes["@mozilla.org/network/file-input-stream;1"]         .createinstance( components.interfaces.nsifileinputstream ); is.init( file,0x01, 00004, null); var = components.classes["@mozilla.org/network/file-input-stream;1"]         .createinstance( components.interfaces.nsifileinputstream ); is.init( file,0x01, 00004, null);  var sis = components.classes["@mozilla.org/scriptableinputstream;1"]         .createinstance( components.interfaces.nsiscriptableinputstream ); sis.init( ); var output = sis.read( sis.available() ); 

the code not work


Comments