This chapter is all about Mega App; however, Mega App still needs some improvements that you can add to it. They are as follows:
Instead of copying the image files to our
app
directory when a photo is captured using a camera or picked from the device gallery, we can move the picture file completely to avoid file redundancy. In order to do this, we can simply replacefile.copyTo()
withfile.moveTo()
inFileManager
and change the method name tomoveFileToDirectory
.Instead of only deleting the file reference in the Local Storage when removing a memo (or memos) as requested by the
removeMemo()
orremoveAllMemos()
methods ofMemoManager
, we can delete the physical files as well using theremove()
method of theFileEntry
Cordova object and adding this to a new method (deleteFile
) ofFileManager
. ThedeleteFile()
method will be called by theremoveMemo()
andremoveAllMemos()
methods to make sure that the memo files are completely removed from the device's filesystem...