So far, we have seen how to detect the online/offline mode and store the data and images locally. The last thing left is to cache the application code, so that they are downloaded locally and are available for offline use. In this recipe, we will go through the steps to achieve it.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file named
touch.manifest
and paste the following code into it:CACHE MANIFEST #version 0.14 index.html touch-charts/sencha-touch.js touch-charts/resources/css/sencha-touch.css ch08/ch08.css ch08/ch08_01.js
Modify the
index.html
file to include the manifest file as follows:<html manifest="touch.manifest">
Add the following to the
mime.types
file of Apache Web Server:text/cache-manifest manifest
Deploy and access it from the device of your choice.