07-12-2011 11:18 PM
Anyway, I find my world opened up a bit and starting to think about a more dynamic environment and unsure of whether WebWorks and the PUSH API can be used to achieve it.
For an app I'm looking at developing, I need the contents of a page to be updatable by a server of some kind. I'm not thinking about creating a web service and pulling HTML fragments with AJAX calls. Instead I'm thinking of replacing a page completely with a new version being pushed to the device using the Push APIs. Will this work? I don't want to require the application to be running when the push call comes in. Instead I'd like the page pushed and pre-loaded on the device so when the app starts it simply displays the page that was pushed.
Maybe this is a stoopid noobie question, but is this possible? If not, is there another approach to fetching dynamic content without using a web service call or simply referencing the page on the server directly? I'd still like the app to function off-line and not require connectivity.
07-13-2011 01:50 AM
I could be wrong but i think you would have to have the app loaded as that becomes the listener for any push messages being sent.. You can tweak the config to start the application at power-on / install...
I think push had an 8K data limit or something like that (again i could be wrong) so you might need to just use push as a notification to go fetch some content from a web service... i.e. isntead of polling a web service the push would say what to go and fetch, from where etc so you app just goes and does it and then displays it.
07-13-2011 02:43 AM
We have created such an app before, yes it is possible.
We used BES only.
We wrote a server side program which pushes the HTML pages + JS + CSS files etc to the browser cache.
This way when the user goes to the url the next time all pages have been updated.
** note ** in the latest 6.0 devices the JS and CSS files do to NOT get updated if the file is in the cache already!!!! ONLY HTML files (another RIM gem)
There is a file size limit for pushed content, but this is configurable on the BES.
We have had some issues with regards pushing a large number of files (approx > 30) to the BES in a single push process. The BES has issues handling all the files hitting it in quick sucession.
Our solution was to add a 1 second delay before pushing each file, that way the BES can handle it.
I'm not sure about doing it with a webworks app, I can't see why not though.