David Dhuyveter
David Dhuyveter

Reputation: 1416

IBM Worklight 6.0 - Dojo application doesn't work on Samsung Galaxy S3

I haven't been able to get any worklight/dojo apps to work on the Samsung Galaxy S3. I have put together a trivial Worklight application in Worklight Studio v6. It has 2 views. The first view has a text box and a button, the second view has a text box.

<div data-dojo-type="dojox.mobile.ScrollableView" id="view0"
    data-dojo-props="selected:true">
    <div data-dojo-type="dojox.mobile.Heading"
        data-dojo-props="label:'Page 0'"></div>
    <input data-dojo-type="dojox.mobile.TextBox">
    <button data-dojo-type="dojox.mobile.Button" id="theButton">Page
        1</button>
</div>
<div data-dojo-type="dojox.mobile.View" id="view1">
    <div data-dojo-type="dojox.mobile.Heading"
        data-dojo-props="label:'Page 1',back:'back',moveTo:'view0'"></div>
    <input data-dojo-type="dojox.mobile.TextBox">
</div>

The button on view0 is connected to a handler that transition to view1, and the header on view1 has a back button.

        dijit.registry.byId("theButton").on("click", function() {
            dijit.registry.byId("view0").performTransition("view1", 1, "slide");
        });

That's all there is to the app. It works everywhere I've tried it (emulators and Motorola Droid 4) except on the Galaxy S3. On the Galaxy, it looks like the dojo parser is failing. The page is white, the text boxes and button from both views are shown on the initial page, but there are no headers and nothing happens when you click on the button. Both the Motorola (where it works), and the Samsung (where it doesn't) are running Android 4.1.2.

Looking in LogCat for the Samsung, I see a few errors that I don't see on other platforms:

08-01 16:51:42.752: D/SimpleTest(26821): before: app init onSuccess
08-01 16:51:42.782: E/SpannableStringBuilder(26821): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-01 16:51:42.782: E/SpannableStringBuilder(26821): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-01 16:51:42.782: D/SimpleTest(26821): after: app init onSuccess
08-01 16:51:42.782: D/SimpleTest(26821): added onPause event handler 
08-01 16:51:42.782: D/SimpleTest(26821): wlclient init success
08-01 16:51:44.464: D/DroidGap(26821): onMessage(spinner,stop)
08-01 16:52:07.038: D/CordovaLog(26821): Error: scriptError
08-01 16:52:07.038: E/Web Console(26821): Error: scriptError:21
08-01 16:52:07.088: D/CordovaLog(26821): Error: scriptError
08-01 16:52:07.088: E/Web Console(26821): Error: scriptError:21

Googling around, I find references to the SPAN_EXCLUSIVE_EXCLUSIVE error. It seems to be associated with the Swype, or SwiftKey keyboards, or to Samsung TouchWiz. Most references to this problem are from folks doing Android native development, not hybrid app development, and other than disabling keyboards, I'm not finding many answers. I tried disabling the Swype keyboard, but that didn't change anything. Has anyone else seen this problem? Has anyone gotten a Worklight 6 dojo app to run on a Galaxy S3?

Upvotes: 0

Views: 635

Answers (2)

Ken Vernaillen
Ken Vernaillen

Reputation: 859

https://dl.dropboxusercontent.com/u/40842201/Worklight%20Samsung%20fix/mobile-ui-layer.js

Try to use this 'mobile-ui-layer.js' in your www/layers folder. Just copy the file and recompile the application.

The fix is based on the following problem:

Upvotes: 1

Idan Adar
Idan Adar

Reputation: 44516

This will be fixed in a near future release for Worklight 6.0.

In the meanwhile please see the following Stackoverflow questions on the same topic:

Upvotes: 0

Related Questions