Known Issues for Hybrid Web Container for Windows and Windows Devices

Learn about known issues and apply workarounds for Hybrid Web Container (HWC) development as they pertain to Windows and Windows Mobile devices.

Issue #Description
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-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-197
On Windows Mobile, when changing between landscape and portrait orientation, the spinner disappears.

Workaround: None.

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-93
On Windows Mobile, the removeMenuItem() JavaScript API in API.js, does not work.

Workaround: None.

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

Workaround: None.

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