I have an offline application cordova, composed of simple html and pictures, all inserted in a sub folder (android_asset/www/app). I would like to add a second online application (android_asset/www/update/) that, check for update, download and replace the first. Is this a reasonable solution for in app synchronization?
Thanks for the time
You could achieve desired functionality if you will use Cordova File Plugin.
Main trick is to load files not from
android_asset/www/app, but from location on the phone storage, using cdvfile protocol (which point to the file location on the phone SDcard).
- When you application starts first time, you will go to you server and save latest app version to the phone storage, and then launch you app logic code from there.
- When you check for updates, you download new files to you app location and next time application will use these files.
cordova-app-loader is an easy to use plugin to update app files via 3 simple steps:
check()for a new manifest
It supports android and iOS