How to Delete and Screenshot Image in Android

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) {
                  // The file has been removed succesfully
                  // Error deleting the file
                 // The file doesn't exist

Any help will be greatly appreciated!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.