It is easiest to learn how to call the Hybrid Web Container by examining the API.js and Utils.js files, which are located in <SUP_HOME>\UnwiredPlatform\MobileSDK<version>\HybridApp\API\AppFramework.
if (isWindowsMobile()) { var xmlhttp = getXMLHTTPRequest(); xmlhttp.open("POST", "/sup.amp?querytype=setscreentitle&version=2.0", false); xmlhttp.send("title=" + encodeURIComponent(screenTitle)); } else if (isIOS()) { var xmlHttpReq = getXMLHTTPRequest(); xmlHttpReq.open("GET", "http://localhost/sup.amp?querytype=setscreentitle&version=2.0&title=" + encodeURIComponent(screenTitle), true); xmlHttpReq.send(""); } else if (isAndroid()) { var request = "http://localhost/sup.amp?querytype=setscreentitle&version=2.0&title=" + encodeURIComponent(screenTitle); _WorkflowContainer.getData(request); } else { //must be BlackBerry var xmlhttp = getXMLHTTPRequest(); xmlhttp.open("POST", "http://localhost/sup.amp?querytype=setscreentitle&version=2.0", false); xmlhttp.send("title=" + encodeURIComponent(screenTitle)); }
Sets the native screen title on the Hybrid Web Container.
Closes the native Hybrid Web Container (Windows Mobile only).
Adds a single menu item to the Hybrid Web Container.
Removes all the menu items from the Hybrid Web Container.
Clears the entire Online Request cache for the current Hybrid App.
Clears a single Online Request cache entry for the current Hybrid App.
Logs a message to the AMPHostLog.txt (mocalog.txt for iOS) on the device. You can retrieve this log file remotely from Sybase Control Center.
Shows a native platform certificate picker on the device for selecting certificate credentials.
On iOS, this function shows the URL in the Hybrid Web Container in a separate browser instance. On all other platforms, this launches the native Web browser in another window with the given URL.
Using third party file viewers, this function displays an attachment that has previously been downloaded using the downloadattachment querytype in a separate window.
Using third party file viewers, this function displays an attachment that was included as part of the Hybrid App .zip package, in a separate window.
This function executes an online request to the Unwired Server synchronously, in other words, a network connection must be available. This can indicate results should be cached for future access (in which case a network connection does not need to be available).
Requests an attachment to be downloaded from the Unwired Server through an object query. A network connection is required for this operation. This operation occurs asynchronously, and the calling JavaScript is notified when it is complete.
Submits the current MessageValueCollection to the Unwired Server for processing by the server plug-in. This operation occurs asynchronously. If a network connection is not available when this operation is performed, the request is queued up and executed the next time a network connection is available.
Shows a message box in native code (iOS and Android platforms only).
Requests the Hybrid Web Container for the transform data (the contents of the e-mail message) for the current message.
Instructs the Hybrid Web Container to add the supplied list of menu items.
Notifies the Hybrid Web Container that a screen navigation is occurring, and to update credentials in the credentials cache, if required.