嗨我正在做一個android phone應用程序起訴phone.Here我必須將pdf文檔保存在手機內存memory.But它是存儲在手機SD卡。 請幫我保存的PDF文件在手機的內部記憶我的代碼是提前如何將文件保存在手機內存中?
var filename = "read-write.txt";
var filePath = "file:///sdcard/read-write.txt";
function saveFile(){
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccessSave,onErrorSave);
}
function onSuccessSave(fileSystem){
var sdcardEntry = fileSystem.root;
sdcardEntry.getFile(filename,{create: true}, gotFileEntry, failEntry);
}
function gotFileEntry(fileEntry){
fileEntry.createWriter(gotFileWriter, failWrite);
}
function gotFileWriter(fileWriter){
fileWriter.onwrite = function (evt) {
alert("Write was successful!");
document.getElementById("textarea").value = "";
};
fileWriter.write(document.getElementById("textarea").value);
}
function failWrite(error){
alert("Failed to get a file writer for " + filename);
}
function failEntry(error){
alert("Got error while reading " + filename + " " + error);
}
function onErrorSave(error){
alert("Got Error while gaining access to file system");
}
謝謝!
Android Manifest需要哪些改變?我有同樣的問題 –
' –