Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova auto update application folder

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

like image 878
Neji Avatar asked Aug 28 '14 15:08

Neji


2 Answers

cordova-app-loader is an easy to use plugin to update app files via 3 simple steps:

  1. check() for a new manifest
  2. download() files
  3. update() your app!

It supports android and iOS

like image 175
Ali Gonabadi Avatar answered Sep 20 '22 17:09

Ali Gonabadi


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).

  1. 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.
  2. When you check for updates, you download new files to you app location and next time application will use these files.
like image 21
codevision Avatar answered Sep 20 '22 17:09

codevision