In my app I have a webView with images and CSS and it works perfectly. I have a default set of HTML, CSS, and images that live in the resources directory incase the app has no internet access when its first opened. In apps.js I have code that will download a more recent version of the HTML, and CSS. My issue is with the images because currently the the app has no idea of what to download. I was wondering if anyone has some suggestions or sample code of how to parse the HTML document looking for the <IMG> tag's source properties. I was also thinking I could add a text file on the server with a list of images to download, then download that list, and loop through it downloading each image. I dont expect many images but I expect this area of the app to be updated frequently.
Any suggestions or sample code would be greatly appreciated.
If you're going to be dealing with downloading the images, you may want to use YQL to scrape the page for images and download them. This will ensure that you always have the latest version of the page, and when you don't have connectivity, then you'll still have the last version to show. YQL is built in to the Titanium core. It makes it very easy to do exactly what you are trying to do.
Think you can help? Login to answer this question!