Worklight 5.0.6 - 混合应用程序在不同 Android 手机中的意外行为
Posted
技术标签:
【中文标题】Worklight 5.0.6 - 混合应用程序在不同 Android 手机中的意外行为【英文标题】:Worklight 5.0.6 - Unexpected behavior of hybrid application in different android phones 【发布时间】:2014-01-23 06:51:59 【问题描述】:我在为不同的 android 手机测试内置 worklight 的应用程序时遇到问题。 我有 nexus 4 和 samsung note2 进行测试,应用程序在 nexus 上运行良好,具有所有本机和 jquery 移动功能,但在三星 note2 的情况下,这些功能无法始终如一地工作。事实上,在大多数情况下,本机和 JQuery 移动功能在三星 note2 中根本不起作用!我们无法追踪问题。
在 Samsung note2 上无法运行但在 nexus 4 上运行良好的 JQuery 移动部分是:
<div id="Task_page" style="margin-top: -15px;">
<a href="#TaskManagerPopUp" data-rel="popup" data-position-to="window" data-transition="pop">click here</div>
<div data-role="popup" id="TaskManagerPopUp" class="bubble1" data-theme="d">
<a href="#popupMenusms" data-rel="popup" data-position-to="window"
data-transition="pop">for jquery function</a>
<a href="" onclick="call(9060606060)">call</a>
<a href="" onclick="locate("address is here")">navigate</a>
</div>
<div data-role="popup" id="popupMenusms" data-theme="d">
<label>heay this is 2nd popup</label>
</div>
</div>
三星 Note2 上永远不会显示第二个弹出窗口
native部分是一个打开dailer和地图导航的插件。
-
插件的 javascript 包装器包含在主 html 文件中。
有一个全局函数可以调用dailer和地图导航。
//global function in main js file for dailer
function call(phoneNmber)
window.plugins.phoneDialer.dial(phoneNmber);
//global function for navigator
function locate(address)
showBusy();
var invocationData =
adapter: 'LatLang',
procedure: 'getGmapLatLng',
parameters: [address]
;
WL.Client.invokeProcedure(invocationData,
onSuccess : onnavigateJobSuccess,
onFailure : onnavigateJobFailed,
timeout : 30000
);
function onnavigateJobSuccess(result)
hideBusy();
if(result.invocationResult.isSuccessful)
userlat=result.invocationResult["lat"];
userlang=result.invocationResult["lng"];
cordova.require('cordova/plugin/phonenavigator').doNavigate(userlat, userlang, successnavigate, errornavigate);
function onnavigateJobFailed(error)hideBusy();
function successnavigate()
function errornavigate()
在导航功能中,我将目的地的纬度和经度传递给cordova插件。
在第一个弹出窗口中呼叫和导航在 nexus 4 上运行良好,但在三星 Note2 上不起作用
1来自 logcat 的第二个弹出窗口的日志,即-popupMenusms,未显示在 NOTE2 上:
01-28 12:53:15.717: D/GestureDetector(3603): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 4 mFalseSizeCnt:0
01-28 12:53:15.722: V/webview(3603): singleCursorHandlerTouchEvent -getEditableSupport FASLE
01-28 12:53:16.067: I/GATE(3603): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 12:53:16.067: D/Cordova(3603): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 12:53:16.067: D/WebView(3603): loadUrlImpl: called
01-28 12:53:16.067: D/DroidGap(3603): onMessage(onNativeReady,null)
01-28 12:53:16.072: D/DroidGap(3603): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 12:53:16.092: D/webcore(3603): CORE loadUrl: called
01-28 12:53:17.707: D/GestureDetector(3603): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0
01-28 12:53:17.717: I/GATE(3603): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 12:53:17.717: D/Cordova(3603): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 12:53:17.722: D/WebView(3603): loadUrlImpl: called
01-28 12:53:17.722: D/DroidGap(3603): onMessage(onNativeReady,null)
01-28 12:53:17.722: D/DroidGap(3603): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 12:53:17.767: D/webcore(3603): CORE loadUrl: called
2在一个地方工作的dailer函数给出了日志:
01-28 13:12:46.305: D/GestureDetector(31954): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 10 mFalseSizeCnt:0
01-28 13:12:46.310: V/webview(31954): singleCursorHandlerTouchEvent -getEditableSupport FASLE
01-28 13:12:46.670: I/GATE(31954): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 13:12:46.670: D/Cordova(31954): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 13:12:46.670: D/WebView(31954): loadUrlImpl: called
01-28 13:12:46.670: D/DroidGap(31954): onMessage(onNativeReady,null)
01-28 13:12:46.670: D/DroidGap(31954): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 13:12:46.775: D/webcore(31954): CORE loadUrl: called
01-28 13:12:47.725: D/GestureDetector(31954): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0
01-28 13:12:47.730: V/webview(31954): singleCursorHandlerTouchEvent -getEditableSupport FASLE
01-28 13:12:48.045: D/FieldWork(31954): Dailers cordova.exec called with ::9854785633
01-28 13:12:48.115: D/DroidGap(31954): Paused the application!
01-28 13:12:48.115: D/CordovaWebView(31954): Handle the pause
01-28 13:12:48.120: D/WebView(31954): loadUrlImpl: called
01-28 13:12:48.130: I/GATE(31954): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 13:12:48.130: D/webcore(31954): CORE loadUrl: called
01-28 13:12:48.150: D/Cordova(31954): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 13:12:48.150: D/WebView(31954): loadUrlImpl: called
01-28 13:12:48.155: D/DroidGap(31954): onMessage(onNativeReady,null)
01-28 13:12:48.155: D/DroidGap(31954): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 13:12:48.205: D/webcore(31954): CORE loadUrl: called
01-28 13:12:48.495: D/webviewglue(31954): OnTrimMemory with EGL Context 0x58a63c78
3 dailer 功能在不工作时给出的日志如下:
01-28 13:04:25.507: D/GestureDetector(26533): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 3 mFalseSizeCnt:0
01-28 13:04:25.517: V/webview(26533): singleCursorHandlerTouchEvent -getEditableSupport FASLE
01-28 13:04:25.862: I/GATE(26533): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 13:04:25.862: D/Cordova(26533): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 13:04:25.862: D/WebView(26533): loadUrlImpl: called
01-28 13:04:25.867: D/DroidGap(26533): onMessage(onNativeReady,null)
01-28 13:04:25.867: D/DroidGap(26533): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html#&ui-state=dialog)
01-28 13:04:25.902: D/webcore(26533): CORE loadUrl: called
01-28 13:04:26.917: D/GestureDetector(26533): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0
01-28 13:04:26.927: I/GATE(26533): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
01-28 13:04:26.927: D/Cordova(26533): onPageFinished(file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 13:04:26.927: D/WebView(26533): loadUrlImpl: called
01-28 13:04:26.927: D/DroidGap(26533): onMessage(onNativeReady,null)
01-28 13:04:26.932: D/DroidGap(26533): onMessage(onPageFinished,file:///data/data/com.FieldWork/files/www/default/FieldWork.html)
01-28 13:04:26.932: D/webcore(26533): CORE loadUrl: called
【问题讨论】:
嘿 Idan Adar,我刚刚编辑了我的问题。 在 Note2 中失败时,您在 LogCat 中看到了什么? 嘿,我已经添加了日志: 1. 当第二个弹出窗口出现时。 2.当dailer工作一切正常时。 3.当dailer不工作时。导航功能也是如此。 logcat 没有显示任何错误,但是拨号器功能在一个地方工作和在另一个地方不工作的日志之间存在一些差异。但我无法了解问题所在。 @Idan Adar 我也有同样的问题 【参考方案1】:据我所知,三星严重破坏了他们对某些设备的支持。 看看以下是否有帮助。
如果发生以下情况,请尝试将侦听器添加到 touchstart
。singleCursorHandlerTouchEvent -getEditableSupport False
phonegap + android Touch events Error singleCursorHandlerTouchEvent -getEditableSupport FalsesingleCursorHandlerTouchEvent -getEditableSupport FASLE bug
$('.element').on('touchstart', function(ev)
ev.preventDefault();
);
【讨论】:
以上是关于Worklight 5.0.6 - 混合应用程序在不同 Android 手机中的意外行为的主要内容,如果未能解决你的问题,请参考以下文章
IBM Worklight 5.0.6 - 在哪里可以找到 5.0.6 存储库?
IBM Worklight v 5.0.6 - 无法在 Windows Phone 7.5 环境中导航多页
IBM Worklight 5.0.6.1 - 使用加密的 worklight.properties 文件保护 Worklight 控制台