77975

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

Question:

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) <strong>except</strong> 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 <strong>both</strong> 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?

Answer1:

<a href="https://dl.dropboxusercontent.com/u/40842201/Worklight%20Samsung%20fix/mobile-ui-layer.js" rel="nofollow">https://dl.dropboxusercontent.com/u/40842201/Worklight%20Samsung%20fix/mobile-ui-layer.js</a>

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:

<ul><li>

<a href="https://stackoverflow.com/questions/17543998/ibm-worklight-6-0-how-to-include-dojo-patch-with-pre-built-dojo-layers" rel="nofollow">IBM Worklight 6.0 - How to include Dojo patch with pre-built Dojo layers?</a>

</li> <li>

<a href="https://bugs.dojotoolkit.org/ticket/17164" rel="nofollow">https://bugs.dojotoolkit.org/ticket/17164</a>

</li> </ul>

Answer2:

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:

<ul><li><a href="https://stackoverflow.com/questions/17546952/worklight-core-web-layer-js-errors" rel="nofollow">Worklight core-web-layer.js errors</a></li> <li><a href="https://stackoverflow.com/questions/17543927/ibm-worklight-6-0-unable-to-run-sample-hybrid-worklight-app-using-dojo-toolkit" rel="nofollow">IBM Worklight 6.0 - Unable to run sample hybrid worklight app using dojo toolkit for android environment on avd?</a></li> <li><a href="https://stackoverflow.com/questions/17543998/ibm-worklight-6-0-how-to-include-dojo-patch-with-pre-built-dojo-layers" rel="nofollow">IBM Worklight 6.0 - How to include Dojo patch with pre-built Dojo layers?</a></li> </ul>

Recommend

  • Xamarin.Forms: Start an activity using DependencyService
  • Trying to find and install libstdc++.so.5 to run C++ with mex for MATLAB
  • Automatically answer call in android 2.1
  • Android Emulator: Receive SMS sent from emulator on a port
  • Xamarin forms Android how We change Tabbed Page Icon Size
  • Android Xperia X10 SoundPool
  • How to use `MediaElement` to play sound in Android?
  • Spinner showing items as Drop Down List
  • Azure Mobile Services with Existing Database (without Schema changes)
  • List installed media players Android
  • Inline codes are not highlighted after using “knit html” function in Rstudio
  • jquery select nested div
  • How to : get port number of AVD and send message to itself
  • When Toggled and disabled android switch is all greyed out
  • how to find out carrier's name in javascript or php
  • Making Android NDK apps with NativeActivity?
  • How to import fonts with pure JS? [duplicate]
  • MOTODEV Studio issue with SDK Install
  • ReplaceWith carousel-inner with new items
  • How to push ViewController with slide effect from left to right? Animation name required
  • Transition height onload of d3js rect svg
  • Bootstrap Carousel Next/Prev not working
  • App Memory Usage differs between Devices
  • Error Installing Windows 10 development tools for Visual Studio 2015 RC on Windows 8.1
  • CUDA Debugging - VS on windows workstation, GPUs on Linux server?
  • MAVEN : Run Multiple Maven Project using Maven Test
  • How can I prevent the need to copy strings passed to a avr-gcc C++ constructor?
  • How to log in to an HTTPS website with Jsoup?
  • Is it possible to run clang with llc flags
  • Adding elements to a huge XML file
  • How integrated is Collada to OpenGL ES
  • Jackson Parser: ignore deserializing for type mismatch
  • req.body is undefined - nodejs
  • How to recover from a Spring Social ExpiredAuthorizationException
  • ILMerge & Keep Assembly Name
  • Symfony2: How to get request parameter
  • Large data - storage and query
  • Akka Routing: Reply's send to router ends up as dead letters
  • WOWZA + RTMP + HTML5 Playback?
  • Is there a mandatory requirement to switch app.yaml?