Question

I am using PhoneGap to develop an application for Android and iOS, and recently in a discussion about this technology, someone told me a seemingly brilliant idea that I can do background updates of my application without having to submit a new application to the app store.

The problem is that, being that I am still fairly new to the HTML5/CSS and Javascript world, I cannot figure out how to download files to my www directory for permanent storage. I can dynamically load JS code or HTML pages at runtime, but I want to create some javascript module that will find that a certain .css, .html, or .js file is out of date, download the new version of that file from some http or file server to the www directory, and then have that new file permanently saved so that it is available the next time the app is opened.

I feel like this should be simple, but I can't figure out how to do it. Thanks in advance.

Was it helpful?

Solution

In order to permanently save files to the devices you will need to make use of the PhoneGap File APIs. Periodic tasks can be achieved with a simple Javascript timer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top