Question

After enabling the Screen Compatibility Mode by changing supports-screens tag in the AndroidManifest.xml, a lot of Worklight and Cordova API method then no longer work.

For example,

  • nothing will happen after pressing the update button when direct update
  • in navigator.notification.confirm , the callback will not work
  • in navigator.camera.getPicture , will stuck after select a picture

If I disable the Screen Compatibility Mode, everything works fine again.

The above happens only in Worklight 6.1 (which uses Cordova 3.1); In Worklight 6.0 (uses Cordova 2.6), everything works fine.

Does anyone a solution?

Update: I create a new project and trying to direct update from Worklight server under the Screen Compatibility Mode. Here is the log from logcat after I press the update button.

05-07 02:46:37.670: I/CordovaLog(2172): Changing log level to DEBUG(3)
05-07 02:46:37.670: D/CordovaActivity(2172): CordovaActivity.onCreate()
05-07 02:46:37.790: D/dalvikvm(2172): GC_FOR_ALLOC freed 295K, 17% free 2602K/3128K, paused 12ms, total 14ms
05-07 02:46:37.790: I/dalvikvm-heap(2172): Grow heap (frag case) to 3.020MB for 268012-byte allocation
05-07 02:46:37.810: D/dalvikvm(2172): GC_FOR_ALLOC freed <1K, 16% free 2863K/3392K, paused 15ms, total 16ms
05-07 02:46:38.000: D/dalvikvm(2172): GC_FOR_ALLOC freed 199K, 15% free 2915K/3392K, paused 17ms, total 18ms
05-07 02:46:38.010: I/dalvikvm-heap(2172): Grow heap (frag case) to 3.338MB for 281892-byte allocation
05-07 02:46:38.040: D/dalvikvm(2172): GC_FOR_ALLOC freed <1K, 14% free 3190K/3668K, paused 32ms, total 32ms
05-07 02:46:38.250: D/CordovaWebView(2172): CordovaWebView is running on device made by: unknown
05-07 02:46:38.280: D/JsMessageQueue(2172): Set native->JS mode to 2
05-07 02:46:38.320: D/CordovaActivity(2172): CordovaActivity.init()
05-07 02:46:38.380: W/com.worklight.androidgap.analytics.WLAnalytics(2172): TLF_configurator.enable was called, but the required Tealeaf libraries are not present in the classpath.
05-07 02:46:38.450: D/Whitelist(2172): Unlimited access to network resources
05-07 02:46:38.450: I/CordovaLog(2172): Changing log level to DEBUG(3)
05-07 02:46:38.450: D/CordovaActivity(2172): Resuming the App
05-07 02:46:38.450: D/CordovaActivity(2172): CB-3064: The errorUrl is null
05-07 02:46:38.500: I/Choreographer(2172): Skipped 34 frames!  The application may be doing too much work on its main thread.
05-07 02:46:38.690: D/SoftKeyboardDetect(2172): Ignore this event
05-07 02:46:38.750: D/WLDroidGap(2172): no need to check web resource integrity
05-07 02:46:38.950: D/(2172): HostConnection::get() New Host Connection established 0xb9142ce0, tid 2172
05-07 02:46:39.320: D/CordovaWebView(2172): >>> loadUrl(file:///android_asset/www/default/index.html)
05-07 02:46:39.320: D/PluginManager(2172): init()
05-07 02:46:39.330: D/CordovaWebView(2172): >>> loadUrlNow()
05-07 02:46:39.710: D/CordovaActivity(2172): onMessage(onPageStarted,file:///android_asset/www/default/index.html)
05-07 02:46:39.850: D/dalvikvm(2172): GC_FOR_ALLOC freed 249K, 15% free 3360K/3924K, paused 14ms, total 15ms
05-07 02:46:40.380: D/dalvikvm(2172): GREF has increased to 201
05-07 02:46:40.410: D/dalvikvm(2172): GC_FOR_ALLOC freed 283K, 16% free 3472K/4104K, paused 15ms, total 17ms
05-07 02:46:40.450: D/dalvikvm(2172): GC_FOR_ALLOC freed 9K, 10% free 3815K/4212K, paused 20ms, total 21ms
05-07 02:46:40.550: D/dalvikvm(2172): GC_FOR_ALLOC freed 15K, 9% free 4137K/4536K, paused 31ms, total 33ms
05-07 02:46:40.660: D/dalvikvm(2172): GC_FOR_ALLOC freed 171K, 12% free 4356K/4896K, paused 14ms, total 15ms
05-07 02:46:40.780: D/dalvikvm(2172): GC_FOR_ALLOC freed 388K, 15% free 4449K/5220K, paused 14ms, total 15ms
05-07 02:46:40.990: D/CordovaWebViewClient(2172): onPageFinished(file:///android_asset/www/default/index.html)
05-07 02:46:40.990: D/CordovaActivity(2172): onMessage(onPageFinished,file:///android_asset/www/default/index.html)
05-07 02:46:41.100: D/CordovaActivity(2172): onMessage(spinner,stop)
05-07 02:46:41.240: D/CordovaNetworkManager(2172): Connection Type: 3g
05-07 02:46:41.240: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkStatus.getConnectionInfo blocked the main thread for 23ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.300: D/TilesManager(2172): Starting TG #0, 0xb91c3520
05-07 02:46:41.410: D/CordovaNetworkManager(2172): Connection Type: 3g
05-07 02:46:41.430: D/CordovaActivity(2172): onMessage(networkconnection,3g)
05-07 02:46:41.630: W/PluginManager(2172): THREAD WARNING: exec() call to DeviceAuth.getDeviceUUID blocked the main thread for 51ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.860: I/wl.client(2172): WL.Client.init ENTERING
05-07 02:46:41.860: D/NONE(2172): ondeviceready event dispatched
05-07 02:46:41.880: I/wl.client(2172): WL.Client onEnvInit ENTERING
05-07 02:46:41.900: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.setNativeOptions blocked the main thread for 55ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.910: D/NONE(2172): wlclient init started
05-07 02:46:41.930: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.950: D/NONE(2172): Read cookies: null
05-07 02:46:41.980: D/NONE(2172): CookieMgr read cookies: {}
05-07 02:46:42.010: W/NONE(2172): Your application is using the WL.OptionsMenu API. Note that, if your application targets Android 3.0 (API level 11) or higher, WL.OptionsMenu might have no effect, depending on the device.
05-07 02:46:42.040: D/NONE(2172): addDeviceIDHeader deviceIDSuccessCallback
05-07 02:46:42.120: D/NONE(2172): connectOnStartup
05-07 02:46:42.140: D/NONE(2172): connectOnStartup isCertificateExists:  false
05-07 02:46:42.140: D/NONE(2172): Request [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init]
05-07 02:46:42.500: W/PluginManager(2172): THREAD WARNING: exec() call to Utils.writePref blocked the main thread for 72ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:42.650: D/NONE(2172): Request [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init]
05-07 02:46:42.650: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 38ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:43.300: D/CordovaActivity(2172): onMessage(spinner,stop)
05-07 02:46:43.420: D/dalvikvm(2172): GC_FOR_ALLOC freed 1685K, 36% free 3422K/5340K, paused 27ms, total 38ms
05-07 02:46:43.430: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 135ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:43.450: D/NONE(2172): response [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init] success: /*-secure-
05-07 02:46:43.450: D/NONE(2172): {"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"j9dne6vt6sf2t0bgresgv1bkfo","attributes":{},"isUserAuthenticated":1,"displayName":"j9dne6vt6sf2t0bgresgv1bkfo"},"wl_deviceNoProvisioningRealm":{"userId":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@685f0a"},"isUserAuthenticated":1,"displayName":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9"},"wl_anonymousUserRealm":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"}},"userPrefs":{},"gadgetProps":{"directUpdate":{"updateUnpackedSize":1197037,"availableSkins":["default"],"checksum":1927153879,"updateSize":387359},"ENVIRONMENT":"android"},"userInfo":{"SubscribeServlet":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_antiXSRFRealm":{"userId":"j9dne6vt6sf2t0bgresgv1bkfo","attributes":{},"isUserAuthenticated":1,"displayName":"j9dne6vt6sf2t0bgresgv1bkfo"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@685f0a"},"isUserAuthenticated":1,"displayName":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9"},"myserver":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"},"wl_anonymousUserRealm":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"}}}*/
05-07 02:46:43.510: I/wl.client(2172): WL.Client.connect onConnectSuccess ENTERING
05-07 02:46:43.510: D/NONE(2172): wlclient connect success
Was it helpful?

Solution

Please edit your question with the exact version of Worklight Studio that you are using.
You can find it via Eclipse > Help > About > Worklight

You may want to re-download the Developer Edition from the Eclipse marketplace, or if you are an IBM customer/business partner, request the latest iFix release for Worklight 6.1.0.1.

I say this because of the following resolved APAR: PI13286 CALLBACK FROM CAMERA.GETPICTURE IS NOT CALLED WHEN THE CAMERA DONE BUTTON IS PRESSED.

This may resolve the confirm and getPicture issues, maybe Direct Update as well. Better reproduction steps are required for that...

So my suggestion is to first try with the Developer Edition for quick verification, and if required, ask for the iFix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top