Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
Accepted Solution

Architecture?

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

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Architecture?

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/documentation/working_with_config_xml_file_1866970_11.html

 

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/beginner/

 

I hope this information helps.

 

@erikjohnzon
erjohnson@blackberry.com
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: Architecture?

Excellent answer, thanks. Will digest

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-