Start contributing to Mega App

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 replace file.copyTo() with file.moveTo() in FileManager and change the method name to moveFileToDirectory.
  • Instead of only deleting the file reference in the Local Storage when removing a memo (or memos) as requested by the removeMemo() or removeAllMemos() methods of MemoManager, we can delete the physical files as well using the remove() method of the FileEntry Cordova object and adding this to a new method (deleteFile) of FileManager. The deleteFile() method will be called by the removeMemo() and removeAllMemos() methods to make sure that the memo files are completely removed from the device's filesystem.

This is a good chance for you to improve Mega App by making these updates. Let's go and download the App source code from GitHub at https://github.com/hazems/cordova-mega-app and start playing with it. You can also download the source code of this chapter from the book page on the Packt Publishing website.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.216.175