Streamezzo S.A. - All rights reserved
Copyright 2001-2010
How to display web content
It can be convenient to integrate a web view (browser) in order to display web content within a Rich Media Application.
Relevant identified use-cases are:
- Access existing web catalog
- Accessing extra web info related to the currently displayed information
- Add to cart and order on the web
As a consequence some features have been granted in Streamezzo solution in order to provide the ability to interoperate with an integrated web view.
Principle
Streamezzo framework provides the ability to rely on the device native web browser in order to display its view within a Rich Media content. This enables displaying existing web content without leaving the Rich Media Application (no user experience disruption).
Integrating a web view within a Rich Media Application can basically be mapped to the display of any visual element, defining a rectangular area in which the web content is supposed to be displayed.
In addition all usual actions related to a web browser can be offered through the Rich Media content itself, like open URL, stop web page download, go back / forward in already browsed web pages, refresh current web page...

Features
Web view definition
Inserting a web view area within Rich Media content is a 3-steps operation:
- Create a Transform node for the web view (use delta attribute to specify the width and height of this area, use translation attribute to specify its position)
- Instanciate the web view in this Transform node
- Make the web view visible (but default an instanciated web view is NOT visible)
In addition it is also possible to:
- Remove a web view
- React to a set of events (connection operated, loading started / finished, new web content accessed...)
A set of dedicated commands covers such features:
- Instanciate web view:
cmd://wv_createWebView?DEF=[myWebViewDEF]: refers to a Transform node&onSuccess=[mySuccessStartableNodeDEF]&onError=[myErrorStartableNodeDEF]
- Delete web view:
cmd://wv_deleteWebView?DEF=[myWebViewDEF]&onSuccess=[mySuccessStartableNodeDEF]&onError=[myErrorStartableNodeDEF]
- Set web view attributes:
cmd://wv_setWebViewAttribute?DEF=[myWebViewDEF]&visible=[myWebViewVisibility]: TRUE or FALSE (default)&connectingHandler=[myStartableNodeDEFWhenConnecting]&startLoadingHandler=[myStartableNodeDEFWhenLoading]&finishLoadingHandler=[myStartableNodeDEFWhenFinishingLoading]: web content loading is complete or has been stopped&startRenderingHandler=[myStartableNodeDEFWhenRenderingStarts]&errorHandler=[myStartableNodeDEFWhenReadingContentFailed]&navigationHandler=[myStartableNodeDEFWhenRequestingNewWebContent]&navigationURL=[myWebContentURLTextDEF]&onSuccess=[mySuccessStartableNodeDEF]&onError=[myErrorStartableNodeDEF]
Web view commands
Once the web view area has been defined, one will need to specify how to control it, i.e. open URL, browse web content, navigate in browsing history...
Streamezzo frameworks also offers facilities in order to restrict the web navigation to certain URLs only.
A set of dedicated commands covers such features:
- Open a given web content URL:
cmd://wv_openURL?DEF=[myWebViewDEF]&URL=[myWebContentURLTextDEF]: refers to a Text node supposed to contain the URL to open
- Stop current web content download:
cmd://wv_stop?DEF=[myWebViewDEF]
- Allow / Forbid access to a given web content URL:
cmd://wv_allowURL?DEF=[myWebViewDEF]&URL=[myWebContentURLTextDEF]: refers to a Text node supposed to contain the URL to allow / forbid&allowed=[myWebContentURLForwardAllowance]: TRUE or FALSE
- Move forward in downloaded web content history:
cmd://wv_goForward?DEF=[myWebViewDEF]
- Move back in downloaded web content history:
cmd://wv_goBack?DEF=[myWebViewDEF]
- Reload current web content:
cmd://wv_reload?DEF=[myWebViewDEF]
Support
| Android | BlackBerry | BREW | iPhone | J2ME | NS602 FP2/3 | NS603 | NS605 | WM2005 PPC | WM2005 Smart Phone |
| | | | | | | | | |
Typical example
The coding example below stands for an integrated web view, accessing Google website at launch and offering an interface with all usual web browsers features.The current status of the last operation is also displayed, at the bottom of the screen, reacting to all possible events detailed above.
<%
int screenWidth = userAgent.getScreenWidth();
int screenHeight = userAgent.getScreenHeight();
%>
" colorBits="8"
lengthBits="16" resolution="2" idBits="16" scaleBits="15"
encodingType="0"/>
">
">
"/>
">
| Attachment | Size |
|---|---|
| Web_view.swz | 9.46 KB |