1

I have 3rd party images being used in a application. I don't want to download and package them in the app because it would violate copyright.

How can I have the application on first time opening, load all the images and cache them, so that if its opened again offline the images could still be accessed?

Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
  • Isn't caching the images a copyright violation in the same manner? – Alastair Apr 03 '14 at 11:13
  • This blog post should set you on the right track http://www.raymondcamden.com/index.cfm/2012/1/19/Downloading-files-to-a-PhoneGap-application--Part-1 – codemonkey Jun 08 '12 at 11:01

1 Answers1

4

Try using cache manifest: http://www.w3.org/TR/html5/offline.html. Allows you specify content to be cached for offline use.

Change your html tag to:

<html manifest="cache.appcache">

In the cache.appcache file:

CACHE MANIFEST
index.html
image1.jpg
image2.jpg
nathancahill
  • 10,452
  • 9
  • 51
  • 91
  • 1
    Where is `cache.appacache` located? If `index.html` in bundled inside the PhoneGap app I thought it couldn't use a remote manifest file for cross-origin reasons. – speg Jul 20 '12 at 11:13
  • There is no cross-origin restrictions inside a PhoneGap application – Alfonso Marin Dec 04 '13 at 05:32