I am writing my first Android app using PhoneGap, but I'm a little confused by the documentation for the FileReader. I need to take an image file and convert it to a Base64 string using the readAsDataURL() method. From their documentation:
function win(file) { var reader = new FileReader(); reader.onloadend = function(evt) { console.log("read success"); console.log(evt.target.result); }; reader.readAsDataURL(file); }; var fail = function(evt) { console.log(error.code); }; entry.file(win, fail);
I understand pretty much all of that except for the last line: entry.file(win, fail). Nowhere is entry defined, but I assume it is a FileEntry object. The problem is that I have not had much luck finding documentation on how to generate the FileEntry object, and at what point I pass in a file path.