Known Issues for Hybrid Web Container

Learn about known issues and apply workarounds for Hybrid Web Container (HWC) development.

Issue #Description
SMPONP-11056
If the Use backwards-compatiable API for generation (deprecated) option is selected when generating the Hybrid App with the Hybrid App Designer, the generated UI may look like the iOS style UI even if run on Android and BlackBerry devices.

The Use backwards-compatiable API for generation (deprecated) option is used to generate JavaScript code using the SUP 2.1.3/2.2 naming convention, i.e. without hwc prefix for all JavaScript functions. These API signatures have been deprecated beginning with SAP Mobile Platform version 2.2 SP02.

Workaround: Before generating the Hybrid App:
  1. Go to the File Order tab in Application properties.
  2. Click Restore Default.
  3. Manually remove the js files listed in the table which do not exist in the project, such as js/makit/Sybase.MA-22.min.js, and so on.
SMPONP-11047
After filling setting information on an iOS simulator, the Hybrid Web Container displays "Unable to start client engine" and fails to connect to SAP Mobile Server. After filling in the setting information again, Hybrid Web Container connects to the server successfully.

When using iOS simulators, you may get the error "Unable to start client engine" when attempting to connect to SAP Mobile Server, after all connection information has been entered correctly in the Settings screen. This only happens on the simulator and not on real devices.

Workaround: Enter the connection information again and restart the application on the simulator, or use a real iOS device during development.

SMPONP-10777
Android and Blackberry connection failure when using HttpsConnection.

Depending on HTTP server behavior, client connection failures may occur when using the https-proxy plugin's HttpsConnection the first time (compared to the browser's default XMLHttpRequest) to send a HTTP(s) request to a remote server. When the client attempts to authenticate itself using basic authentication, failure may occur even when the user name and password are properly set in the header, with the server returning a 401 error.

Workaround: Send the request with username and password a second time.

SMPONP-10766
An iOS device loops infinitely between HWC and an Afaria client when trying to use Afaria registration in flight mode.

Workaround: None. Keep the device online while performing registration with Afaria.

RTC-387
Sencha Touch 2.1 does not load in the Hybrid Web Container

Workaround: Use a Sencha Touch version other than 2.1, such as 2.0.1 or 2.1.1.

RTC-334
If you migrate or otherwise generate a Hybrid App with the Use Backwards Compatible API option set one way, for example, off, and then afterwards change that setting, for example, to on, certain key files, namely API.js, Utils.js, WorkflowMessage.js, and Custom.js, are not regenerated and, thus, use the wrong API setting compared to the other generated files. 

Workaround: SAP recommends that you decide prior to migration (or, in the case of newly written Hybrid Apps, prior to generation) which API setting you want to use. Failing that, after changing the API setting, manually delete the API.js, Utils.js, WorkflowMessage.js, and Custom.js files and regenerate the Hybrid App with the desired API setting.

RTC-287
On BlackBerry 7 simulators, when a Hybrid App is deployed from the Hybrid App Designer, the simulator fails.

See http://forum.jquery.com/topic/jquery-mobile-demo-page-causes-blackberry-7-1-simulator-browser-to-crash for information. This does not happen on an actual device.

Workaround: Use a BlackBerry 7 device for deploying Hybrid Apps.

RTC-266
JavaScript functions deprecated.
  • showAlertDialog() – the title parameter is no longer used on iOS. It is already ignored on other platforms. This is true only for Sybase Unwired Platform versions 2.1.3 and 2.2 SP02 (2.2.0 and 2.2 SP01 work as before). 
  • showConfirmDialog() – this function does nothing.
Workaround:
  • showAlertDialog() – use the native JavaScript alert() function.
  • showConfirmDialog() – use the native JavaScript confirm() function. 

Alternatively, you can use PhoneGap APIs to display an alert or confirmation dialog. Although the PhoneGap APIs allow you to set the title of the alert and confirmation dialogs, and buttons, the APIs are asynchronous, so you cannot use them as a direct substitute for the showAlertDialog() unless you refactored the code in each instance where it is used.

RTC-240
On Android, PhoneGap Media play function does not play sound when the source is a Web server. This is a known PhoneGap issue and is fixed in PhoneGap (Cordova) version 2.1.0 so that sound files that are stored on the device play correctly.

Workaround: Include the sound files with the application. See the discussion about this problem at:

  https://groups.google.com/forum/?fromgroups=#!topic/phonegap/xCOwgKh0IQ0

RTC-236
When a 2.1.3 or older client tries to connect to a 2.2 or newer server using an invalid URL suffix (such as '/'), the client receives an HTTP authentication challenge and the connection fails.

Workaround: Use a valid URL suffix when attempting to connect a 2.1.3 or older client to a 2.2 or newer server.

RTC-220
In a page of the Hybrid App, the Save or Submit Hybrid App action fails to save the credential information to the local store by providing only the "credential cached user name" without a corresponding "credential cached password."

Workaround: Use the hwc.saveLoginCredentials() JavaScript API to save the user name.

RTC-205
On BlackBerry Torch and Storm devices, when using the Camera API, any picture taken is always rotated 90 degrees to the right.

Workaround:  None. This is a known problem with RIM APIs on these devices. See https://www.blackberry.com/jira/browse/JAVAAPI-701 (requires a login) and http://supportforums.blackberry.com/t5/Java-Development/Storm-Torch-camera-getSnapshot-orientation-issue/td-p/1316867.

RTC-171
If a password is used for automatic device registration using the hwc.saveSettings() API, the password is used only once and is not saved in the Hybrid Web Container.

Upon successful automatic registration, subsequent connections to the server uses the userid+deviceid+authcode combination (the password is not required). This is by design.

Workaround: To save the password in the application, do so in the application code with the secured storage SUPStorage API.

RTC-169
Using the Hybrid Web Container on older BlackBerry devices may result in warnings or errors from the operating system, such as The memory available on your device is low. Close some of the items below.

Workaround: Run the BlackBerry Hybrid Web Container on newer OS 6.x or OS 7.x devices with more memory. There is no fix available from RIM for Java-based platforms. See the following Blackberry sites, which require a login. https://www.blackberry.com/jira/browse/JAVAAPI-2275.

RTC-139
iOS issue in opening apps and messages with the Javascript Metadata API . On iOS, when using the JavaScript API functions (hwc.openApp and hwc.openMessage) that allow the user to open a Hybrid App or message from within another Hybrid App, when opening the Hybrid App from within another application, the previously opened application closes. On platforms other than iOS, when the user closes the newly opened application, the previously opened application is still open.

Workaround: None.

RTC-135
On BlackBerry 5.0, the HTML5 sessionStorage object is not supported.

On both window.open() and window.location.href the HTML5 sessionStorage values are not carried to the next page.

Workaround: None.

RTC-115
Cannot update prepackaged Hybrid Apps.

The version number of the new Hybrid App must be later than the current version number.

Workaround: Edit the manifest.xml file to update the version number and repackage the Hybrid App files.

RTC-111
On Android devices, when attempting to upload log files from the Hybrid Web Container after re-registering the device user, an Upload Failed message is returned periodically.

Workaround: Upload the log files again.

RTC-91
In Hybrid Apps running on iOS devices, when a user enters a string in a numeric field, no error message is given, which allows the user to incorrectly enter string data in a numeric field.

In Hybrid Apps running on iOS, numeric edit boxes do not validate user entries.

Workaround: None.

RTC-90
On all Hybrid Web Container device platforms, when an expired certificate is used for device registration, the error message is MMS Authentication Failed, which does not indicate the root cause of the error. 

Workaround: Make sure your certificate is not expired.

RTC-73
On all platforms, in manual registration mode, after calling the hwc.saveSettings API in hwc-api.js, the client cannot connect to the server.

Workaround: To connect to the server by manual registration, call the hwc.startClient API after the hwc.saveSettings invocation.

RTC-53
On iOS, some APIs, such as SUPStorage, perform slowly when using WiFi with an HTTP proxy.
This happens only when all of the following conditions are true:
  • The Hybrid Web Container experiences long (10 - 75 seconds) delays while processing the JavaScript of Hybrid Apps and navigating between screens.
  • The Hybrid Web Container is running on a device connecting to the network through WiFi.
  • The WiFi access point is using a network HTTP proxy (Settings > WiFi > Choose a Network > HTTP Proxy).

If all of these conditions are true, these workarounds are available depending upon whether the Hybrid App is using JavaScript generated by the Hybrid App Forms Designer or using the Packaging Tool in conjunction with the JavaScript container code that ships with SAP Mobile Platform 2.2.

Workaround #1: If you are using the JavaScript files generated by the Hybrid App Forms Designer, you must edit API.js, SUPStorage.js, and Utils.js, which are located in the html/js directory of the generated application code. For each file:
  1. Search for POST. Each instance is within a function, and typically there is a unique code path per platform.
  2. Identify the isIOS() code branch where an xmlHttpRequest is being opened, and change the last parameter of the open function call for the xmlHttpRequest to change it from false to true.
    For example, in SUPStorage.js, change line 171 from:
    xmlHttpReq.open("POST", "/sup.amp?querytype=workflowstorage&" + versionURLParam, false); 
    to:
    xmlHttpReq.open("POST", "/sup.amp?querytype=workflowstorage&" + versionURLParam, true); 
    Note: If you are deploying the Hybrid App to multiple platforms, make sure these changes affect only the iOS code path, which might mean creating a new “elseif” clause.
  3. Regenerate the Hybrid App package.

Workaround #2: Modify hwc_api.js (usually installed in SMP_HOME\UnwiredPlatform\MobileSDK<version>\HybridApp\Container) in the Hybrid App to look like the following example, and redeploy the application to the Hybrid Web Container. 

/**   
    * Encapsulate the HTTP post method. This function is called internally   
    */   
   hwc.postDataToContainer = function( queryType, data)   
   {   
                try   
 {   
            var response = "";   
            if (hwc.isWindowsMobile()) {   
            xmlhttp = hwc.getXMLHTTPRequest();   
            xmlhttp.open("POST", "/sup.amp?querytype=" + queryType + "&" + hwc.versionURLParam, false);   
           
            xmlhttp.send(data);   
            response = xmlhttp.responseText;   
                   }   
                  else if (hwc.isAndroid()) {   
                     response = _HWC.postData("http://localhost/sup.amp?querytype=" + queryType + "&" + hwc.versionURLParam, data);   
                  }    
                  else if (hwc.isBlackBerry()) {   
                      var xmlhttp = hwc.getXMLHTTPRequest();   
                      xmlhttp.open("POST",
        "http://localhost/sup.amp?querytype=" + queryType + "&" + hwc.versionURLParam, false);   
                      xmlhttp.send(data);   
                         response = xmlhttp.responseText;   
                   }   
                 else if (hwc.isIOS())
        {   
                   var xmlhttp = hwc.getXMLHTTPRequest();   
                  xmlhttp.open("POST", "http://localhost/sup.amp?querytype=" + queryType + "&" + hwc.versionURLParam, true);   
                  try   
                  {   
                      xmlhttp.send(data);   
                  }   
                  catch (ex)   
                  {   
                     if (ex.message.search(/XMLHttpRequest Exception 101/) == -1)   
                     {   
                        throw ex;   
                     }   
               }   
         }   
         return response;   
      }   
      catch (ex)   
      {   
         hwc.log( "hwc.postDataToContainer error: " + ex.message, "ERROR", false);   
      }   
   }; 
RTC-52
A Hybrid App fails to deploy to the device.

If the SAP Mobile Platform is installed in a cluster, and different paths are used on each application service node, the Hybrid App log may contain a message similar to Updated failed for Hybrid App item. SAP Mobile Platform currently assumes that application service nodes are installed in the same path on all the nodes in the cluster, that is, that all application server nodes are installed in the same path on all cluster nodes. It stores full paths in the database during Hybrid App package installation. When the client connects, it looks for those paths in the file system. If the node it is connecting to does not have one of those paths, you see the error.

Workaround: Install SAP Mobile Platform using the same installation path for each node of the cluster.

RTC-51

iOS Hybrid Web Container fails when an Afaria client is not setup for seeding.

If you do not provision the Afaria server with the iOS Hybrid Web Container seeding file, and if the Afaria iOS client is installed on the iOS device and not configured with the connection settings in the iOS Hybrid Web Container, the Hybrid Web Container fails upon start-up. This happens because the Hybrid Web Container launches the Afaria client application to get the seeding file (settings) that can be used to connect to the Afaria server. The Afaria client application fails before relaunching the iOS Hybrid Web Container.

Workaround: If you do not provision the Afaria server with the iOS Hybrid Web Container seeding file, the user must manually enter the connection settings for the Hybrid Web Container before launching it.

This issue does not occur if the Afaria client is not installed on the iOS device.

RTC-37
On Android 3.x devices, when proxy is enabled on the WiFi connection, connecting to SAP Mobile Server directly using the HTTPS protocol makes the Hybrid Web Container client fails.

This is an Android bug. See http://code.google.com/p/android/issues/detail?id=37050 for details.

Workaround: Either turn off the proxy or connect through SAP Relay Server.

CR-708173
When the Hybrid Web Container tries to retrieve data from the MBO package, an Invalid application id <***> for package error appears.
Workaround: In SAP Control Center, manually add an application ID for the MBO package's application list.
  1. Log in to SAP Control Center.
  2. Go to hostname@localhost > Applications and click the Applications tab.
  3. Click Properties.
  4. In Domains and Packages, select the domain that contains the applicable MBO package.
  5. Assign the application ID to the MBO's package's applications list.
CR-705895
After adding JavaScript code in the customAfterMenuItemClick method to update the check box (using JQuery Mobile) state on the screen, the checkbox fails to update.

Workaround: When you use JavaScript to update the check box (using JQueryMobile) value, you must also add the refresh code. For example:

Whole sample in "customAfterMenuItemClick" method of Custom.js

function customAfterMenuItemClick(screen, menuItem) {
    if (screen === "Start" && menuItem === "setCheckbox") {
		var checkbox1 = document.getElementById('checkbox1');  
		checkbox1.checked = true;
		
		var checkbox2 = document.getElementById('checkbox2');
		checkbox2.checked = false;
		
		if (isJQueryMobileLookAndFeel) {
		    $("input[type='checkbox']").checkboxradio("refresh");
		}
    }
}
CR-705219
When the iOS Hybrid Web Container application tries to retrieve seeding information from an Afaria iOS App store hosted package you see this error message: Afaria client application is installed but not configured.
Workaround: Configure Afaria client application and try again or go to the Settings application and enter your configuration information.
  • Seed Enterprise-hosted packages on the Afaria server.
  • Manually configure the connection information.
CR-703883
Switching from one edit box to another on a BlackBerry 7.0 simulator or device using the touch screen or mouse requires two clicks or touches.

Workaround: None for BlackBerry 7.0. Upgrading to BlackBerry 7.1 eliminates the problem.

CR-702603
BlackBerry 7.0 users see a white screen until the Workflow application's activation screen opens. See https://www.blackberry.com/jira/browse/JAVAAPI-119. Note this URL requires a login.

Workaround: None.

CR-693907
Hybrid Web Container occasionally fails on Android 2.2.

This can happen when all of these conditions are present:

  • There is only one read-only edit box control on a single screen, and
  • The application is using jQueryMobile GA version, and
  • You are using an Android 2.2 simulator or Samsung Galaxy device with Android 2.2.

Workaround:

  • Upgrade the OS on the device to Android 2.3, or,
  • If using an Android 3.x simulator, see CR 673572, or,
  • Add one or more controls to the screen.
CR-691005
Image upload may fail on BlackBerry 6 simulators older than version 6.0.0.499.

Workaround: Use a BlackBerry 9800 simulator with version 6.0.0.499 or later.

CR-686465
Camera feature is supported on some device simulators/emulators.

Workaround: Use a physical device.

CR-680253
Images do not appear correctly on mobile devices.

Hybrid Web Container/Workflow applications can display pictures from binary enterprise information system (EIS) data. But when a MBO developer drags and drops a table that contains an image field to create the MBO, the image field maps to a Binary datatype that has a length of approximately 3KB, which may not be large enough for the entire image. At runtime, the binary data of the image may be truncated in the cache database (CDB), and appear incorrectly on the device.

Workaround: When creating the MBO, manually modify the length of the binary field to make sure it is large enough to hold the image binary data, or use the BigBinary datatype instead.