Hybrid App Native Device Functions

Access the native features of the device using the native device functions.

showUrlInBrowser(url)

To have a hyperlink in the default value for the HtmlView control, or for doing customization in Javascript, follow the showUrlInBrowser method without using standard HTML. To add HTML in the default value for the HtmlView control, you can use something similar to:
<html>
<body>
<b>Welcome</b><br>
<br>Your activation was successful, the newly created Hybrid App requests will automatically be pushed to you.<br>
<br>For more information contact your administrator or visit us at:<br>
<br>
<a href="javascript:showUrlInBrowser('http://www.sap.com/
unwiredenterprise')">SAP Mobile Platform</a>
</body>
</html>

Example 2

View an attachment such as an image, a Word document, a PDF file, and so on as part of the Hybrid App package. This example uses an image file.
  1. Generate the Hybrid App package and its files.
  2. In WorkSpace Navigator, go to the location where the generated Hybrid App files are located and add an images folder under the html folder, for example, Generated Hybrid App\<hybridapp_name>\html\images.
  3. Copy an image to the images folder.
  4. In the Hybrid App Designer, add a menu item to the Hybrid App.
  5. Open the Custom.js file with a text editor and edit the method customBeforeMenuItemClick:
    if (screen === "ScreenKeyName" && menuItem === "ShowAttachment") {
    	showLocalAttachment("html/images/ipod.jpg");
            return false;
        }
    
  6. Save and close the Custom.js file.
  7. Deploy the Hybrid App package to SAP Mobile Server.