Known Issues for Hybrid Web Container

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

Issue #Description
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, delete the API.js, Utils.js, WorkflowMessage.js, and Custom.js files manually and regenerate the Hybrid App with the desired API setting.

RTC-307
When running the iOS Hybrid Web Container for the first time (only), after upgrading it to Sybase Unwired Platform 2.2 SP02, the UI may appear to hang for awhile. The amount of time depends upon the number of Hybrid Apps installed in the container.

Workaround: None. Wait up to a minute for the operation to complete.

RTC-301
The Timepicker fails to work on iOS4.3.x.

Workaround: Use iOS version 5.0 or later.

 
RTC-300
On Windows Mobile, calling a save or submit action to a persisted cached password causes the Hybrid Web Container to crash if the Hybrid Web Container was not registered to Unwired Server.

Workaround: Register the Windows Mobile device to the Sybase Unwired Platform server before saving credential information to the device.

RTC-287
On BlackBerry 7 simulators, when a Hybrid App is deployed from the Hybrid App Designer, the simulator crashes. 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 a real device. Workaround:

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

RTC266
Changes to JavaScript functions.
  • 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.2sp02 (2.2.0 and 2.2sp01 work as before). 
  • showConfirmDialog() – this function does nothing.

These functions are deprecated.

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. Be aware that although the PhoneGap APIs allow you to set the title of the alert and confirmation dialogs, and buttons, the PhoneGap APIs are asynchronous rather than synchronous, so using them as a direct substitute for the showAlertDialog() does not work. That would require refactoring 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-237
For iOS HWC applications, the badge count displayed when a notification is received may not match the number of messages available.

The badge count represents the number of queued items on the server that are waiting to be delivered. This matches the queue count for the application connection as seen in Sybase Control Center. As the items in the queue count includes items that are not necessarily new messages, this does not match the new message count of the Hybrid Web Container inbox.

Workaround: None.

 
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-222
After loading Hybrid Web Container JavaScirpt files (for example, Datajs), a memory leak occurs. Within a closure code, when adding a new window property which references an object, the object is not GC correctly after closing the Hybrid App.
For example, the datajs-1.0.3.js file contains a code pattern like:
(function (window, undefined) { 
if (!window.OData) { 
window.OData = {}; 
} 

var odata = window.OData; 

odata.defaultHttpClient = { 
request: function () { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } 
}; 
})(this);

When exiting the Hybrid App, window.OData still occupies the memory. Then after several times of opening and closing the Hybrid App, an "Out of Memory" error occurs.

Workaround: Manually release the object. For example, add "window.OData = null;" in the hwc.close() function which is invoked when exiting the Hybrid App. Add these lines in hwc.close() to avoid the memory leak:
//datajs
if (window.datajs) { window.ActiveXObject = window.oldActiveXObject; window.datajs = null; window.OData = null; window.oldActiveXObject = null; }
//hwc
window.CallbackSet = null;
window._Picture = null;
//cordova
window.console = null;
window.PhoneGap = null;
window.Cordova = null;
window.plugins = null;
window.addEventListener = null;
window.removeEventListener = null;

On Windows Mobile, if you experience a memory leak under these conditions, restart the device.

RTC-220
In one 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 "credential cached user name" without "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, a picture that is 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   and http://supportforums.blackberry.com/t5/Java-Development/Storm-Torch-camera-getSnapshot-orientation-issue/td-p/1316867.

RTC-197
On Windows Mobile, when changing between landscape and portrait orientation, the spinner disappears.

Workaround: None.

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: If you want 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. A fix for this is not available from RIM for Java-based platforms. See  https://www.blackberry.com/jira/browse/JAVAAPI-2275

 
RTC-156
On Windows Mobile 6.0, if you use the task manager to end the Hybrid Web Container process, you cannot restart the Hybrid Web Container.

Workaround: Do not end the Hybrid Web Container process on Windows Mobile 6.0. It works as expected on Windows Mobile 6.5.

RTC-147
On Windows Mobile, when using the Media Cache function, hwc.MediaCache.getUrl(), if the media resource, such as an image, has a large size, it may fail to display correctly if the user opens and closes the Hybrid App frequently.

Workaround: None.

RTC-143
On iOS devices, a Hybrid Web Container application connection does not receive an Apple Push Notification Service device token until the Hybrid Web Container is restarted.
Workaround: Restart the Hybrid Web Container:
  1. Press and hold the home button and click the minus sign above the Hybrid Web Container.
  2. On the applications screen, click the Hybrid Web Container icon.
  3. Verify the device token has been received by the server by logging in to Sybase Control Center and go to Applications > Application Connections > Application Connection > Apple Push Notifications > APNS Device Token.

    If the APNS Device Token field is populated, the device token was received.

RTC-139
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 higher 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 re-registering the device user, an "Upload Failed" message is returned periodically.

Workaround: Upload the log files again.

RTC-93
On Windows Mobile, the removeMenuItem() JavaScript API in API.js, does not work.

Workaround: None.

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: If you receive an "MMS Authentication Failed" error message, check your certificate to make sure it is not expired.

RTC-88
After changing the default Hybrid App in Sybase Control Center, invoking the Hybrid Web Container on Windows Mobile devices does not open the new default Hybrid App automatically.

Workaround: After changing the default Hybrid App in Sybase Control Center, restart the device.

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: The hwc.startClient API must be called after the hwc.saveSettings invocation to connect to the server by manual registration.

RTC-57
Native spinner does not work on Windows Mobile

The hwc.showProgressDialog and hwc.hideProgressDialog APIs do not work for the Windows Mobile Hybrid Web Container.

Workaround: Open the hwc-comms.js file, and remove for Windows Mobile in the hwc.showProgressDialog and hwc.hideProgressDialog functions. Change:

if (hwc.isWindowsMobile()) { navigator.cursor.setWaiting(); }
else { hwc.getDataFromContainer("showprogressdialog", "&message=" + message); }
to:
hwc.getDataFromContainer("showprogressdialog", "&message=" + message); 
And change:
if (hwc.isWindowsMobile()) { navigator.cursor.setDefault(); }
else { hwc.getDataFromContainer("hideprogressdialog"); }
to:
hwc.getDataFromContainer("hideprogressdialog"); 
RTC-55
The sample code file, AppNotification.cs, which is included in the template source project under the CustomCode folder, does not show a balloon notification.
Workaround:
  1. In the AppNotification.cs file, add a CreateNotificationDelegate delegate definition:
     public delegate void CreateNotificationDelegate(string title, string content); 
  2. Create a notification in UI thread using a delegate:

    In the AppNotification_InstallEvent method, change ShowNotification(title, msg); to Sybase.HybridApp.OMAAT.Framework.BaseForm.Invoke(new CreateNotificationDelegate(ShowNotification), new object[]{title, msg});.

  3. Add a determine statement and remove the notification visible assignment:
    Change:
    private static void OnMessageNotificationClicked(object sender, BalloonChangedEventArgs e)
    { m_Notification.Visible = false; m_Notification.Dispose(); m_Notification = null; }
    to:
    private static void OnMessageNotificationClicked(object sender, BalloonChangedEventArgs e)
    {
    if (e.Visible == false)
    { m_Notification.Dispose(); m_Notification = null; }
    }
RTC-52
A Hybrid App fails to deploy to the device.

If the Sybase Unwired 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. Sybase Unwired Platform currently assumes that application service nodes are installed to the same path on all the nodes in the cluster, that is, that all application server nodes are installed to 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 Sybase Unwired Platform using the same installation path for each node of the cluster.

RTC-51
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 crashes 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-49
On Windows Mobile devices and emulators, Cordova cannot play audio files.

Workaround: None.

RTC-37
On Android 3.x devices, when proxy is enabled on the WiFi connection, connecting to Unwired Server directly using the HTTPS protocol makes the Hybrid Web Container client crash. 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 Sybase Relay Server.

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 Mobile Workflow Forms Designer or using the Packaging Tool in conjunction with the JavaScript container code that ships with Sybase Unwired Platform 2.2.

Workaround #1: If you are using the JavaScript files generated by the Mobile Workflow 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 Mobile Workflow package.

Workaround #2: Modify hwc_api.js (usually installed in SUP_HOME\UnwiredPlatform\MobileSDK22\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);   
      }   
   }; 
CR-708778
If the Relay Server credentials dialog is presented and the iOS Hybrid Web Container application is closed and reopened, any previously saved credentials are retried automatically.

Workaround: Do not close the application when the credentials dialog is presented.

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 Sybase Control Center, manually add an application ID for the MBO package's application list.
  1. Log in to Sybase 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-708122
Native application on Windows Mobile device receives an error, Can't find an Entry Point 'DLL_setMclCallbacks' in a PInvoke DLL 'CMessagingCLient.dll.

This can occur if a 2.1.2 (or older) version of the Hybrid Web Container (HWC) is installed on the same device as a native application using the Sybase Unwired Platform 2.1.3 libraries. The HWC and native applications share a common CMessagingCLient.dll.

Workaround: In order for a 2.1.2 (or older) HWC and a 2.1.3 native app to coexist and both successfully run on the same Windows Mobile device, install only the 2.1.3 version of CMessagingCLient.dll, and load it into memory on the device. Before starting either version of the application, verify that older versions of that DLL are removed from the device.

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.
Workarounds: 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

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-693381
Cannot preview a selected picture On Windows Mobile emulator.

When using the imageElement.src = imageUri in the getPicture function, you cannot preview the selected image on the Windows Mobile emulator. This is because the HTML browser adds an unexpected prefix to the URI, so the Hybrid Web Container cannot find the file to which the URI refers.

Workaround:
  • Preview the image using an actual device instead of the emulator, or,
  • Assign image data instead of an image URI to the image element so the image data can be retrieved through the JavaScript API.
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-689287
2.0 or 2.0 ESD #1 message-based synchronization (MBS) clients and Hybrid Web Container clients may not be able to connect to 2.1 ESD #3 or 2.2 servers.

If 2.0 or 2.0 ESD #1 clients have not connected through an activated registration, and you upgrade to 2.1 ESD #3, those clients may not be able to connect to a 2.1 ESD #3 or a 2.2 server.

Workaround: Implement a server registration that uses an empty application ID, and use manual registration to connect the MBS and Hybrid Web Container 2.0 and 2.0 ESD #1 clients to the server.

CR-688399
On Windows Mobile devices, thumbnails do not show properly if an image has a large size..

The root cause is that Internet Explorer cannot load a large image; try one of these solutions to address the image size:

Workaround #1: Specify a small-sized image as the thumbnail instead of using the original large image, for example:
<img src="default-thumbnail.jpg" width="120" height="120" 
id="Thumbnail" sup_static_options="true" name="Preview" alt="Preview"/>
Workaround #2: Pass the width and height as the parameters in the source of the image control, so the container compresses the original image on the fly, for example:
<img src="default.jpg?width=120&height=120" width="120" height="120" 
id="Thumbnail" sup_static_options="true" name="Preview" alt="Preview"/>

The width and height parameters are supported only on Windows Mobile and may cause display issues on other platforms.

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.