02-26-2013 04:32 AM
If I have understood it correctly an app could either be run completely from a web site or be "packaged" to be run completely standalone. I had an idea of taking the best out of both worlds but I am beggining to think that this is not possible. My idea was to download the web pages (if changes where made) and run the pages locally. This sort of bypasses the "packaging" step so maybe it is not workable. It seems like I have to deside on one way or the other.
How is the app started on the phone? Maybe there is a choice to either start the app locally or start the browser and connect to a website that has the app installed.
Either way, downloading the pages as an initial step and save them does not seem to be an option
Solved! Go to Solution.
02-26-2013 09:18 AM
There are many ways you could architect it yourself. I'll give you the information and you can make the decision:
When a webworks application is loaded the intial page is sourced through your config.xml. This tells the operating system what page to load and render. This page can be either local OR remote. If the page is remote, you will need the proper <access uri="<your domain>" subdomains="true"/>. More info here: http://developer.blackberry.com/html5/documentatio
Once your intial HTML page is loaded it will load all source files and assets associated with that page as well. So you are more then welcome to have JS code that downloads further pages, checks for updates and more. You can use the FIle API to write onto the device: http://www.w3.org/TR/FileAPI/
Now are this stage you still have some options. Your intial file could be packaged into the bar (which is a reccomended approach for offline applications) but it is no necessary. Your goals seem to suggest you might benefit from using the "App Cache" this would allow your pages to sit remotely but take advantage of the WebKit cache on device and only update when necessary. You can find more information on that here: http://www.html5rocks.com/en/tutorials/appcache/be
I hope this information helps.
02-26-2013 11:49 AM
Excellent answer, thanks. Will digest