I am developing an Android App using Phonegap. The users will occationally be saving Screenshot into their cellphones default location. I am already able to find and send these images to my host system. The issue that I am now incountering is that the customer would like the Screenshots deleted once they have been sent to the Host so there is no chance of them selecting them or sending them a second time.
Has anyone got code that will delete Images, Screenshots, or other files? I think that I should be using the Cordova-Plugin-File API. I have also found some sample code (shown below) but I keep getting an “Uncaught TypeError: window.resolveLocalFileSystemURL is not a function.” mesage.
var path = "file:///storage/emulated/0";
var filename = "myfile.txt";
window.resolveLocalFileSystemURL(path, function(dir) {
dir.getFile(filename, {create:false}, function(fileEntry) {
fileEntry.remove(function(){
// The file has been removed succesfully
},function(error){
// Error deleting the file
},function(){
// The file doesn't exist
});
});
});
Any help will be greatly appreciated!
Robert