android - Android 上的工作灯性能不佳

标签 android ibm-mobilefirst

我目前正在测试 worklight,我注意到与 iOs 设备相比,android 设备上的性能损失很大。 (在 asus nexus 7 和 iphone 4 上测试)

第一点是:一个简单的 html 页面在一个简单的 jquery 移动页面转换过程中出现抖动。 没有服务器调用。

我删除了 jQuery 移动转换,因为它使用大量 javascript 而不是 css3 转换功能,但它仍然继续从一个页面倾斜到另一个页面。 我的意思是在 2 个页面之间有 1/10 秒的“黑屏”并且下一页的呈现滞后。

为了分析该问题,我删除了 worklight 层并将简单的 html/jquery 移动页面托管在 apache 网络服务器上,并从我设备的 chrome 浏览器中调用它。 即使有过渡,它也能完美流畅地工作。

之后,我在手机浏览器模拟器中分析了worklight生成的代码,似乎里面有很多wlclient javascript文件,从我的角度来看,这不是实现网页的好方法,而且一个移动的。

有没有办法将所有这些文件编译成一个文件以避免向服务器发出多个 http 请求?

如果我们只需要一小部分,有没有办法避免加载所有客户端 api?我的意思是,如果我不需要encryptedcache,为什么要加载相关的js?

有没有办法强制浏览器引擎在应用程序(chrome、opera、android native...)中使用以测试每个浏览器引擎的性能?

工作灯 5.0.5.20121217-0622 安卓 21.0.0.v201210310015-519525 赢7 64位 eclipse 3.7.2

非常感谢您的帮助。

最佳答案

removed the jQuery mobile transition as it uses a lot of javascript instead of css3 transitions capabilities, but it still continue to tilt from a page to another.

您可以选择不使用 jQuery Mobile 并自行实现动画或使用其他 UI 框架。你也可以试试 creating custom CSS-based transitions适用于 jQuery Mobile。

I removed the worklight layer and hosted my simple html/jquery mobile page on an apache web server and called it from my device's chrome browser

Worklight 的文件不托管在任何服务器上,它们是您安装在设备上的 .apk 的一部分。 Web View 中的性能不同于其他浏览器(如 Google Chrome)中的性能。您可以通过查看 other people are doing 来尝试改进它.

Is there a way to compile all those files in one to avoid multiple http requests to the server ?

无法将其作为“全部构建并部署”步骤的一部分来执行。您可以编辑为每个环境生成的 native 文件夹的内容,并手动将内容放入单个文件中。但是,我不推荐这种方法,因为当您“全部构建并部署”时,这些更改将被覆盖。阅读this如果您想使用 Ant 减少资源,但我怀疑它是否会显着提高性能。

Is there a way to avoid to load all the client api if we just need a small part? I mean, if I don't need encryptedcache, why load the related js?

没有,如果你看了我对上面问题的回复,你可以手动完成。

Is there a way to force the browser engine to use inside the app (chrome, opera, android native...) in order to test the perf of each one?

不,您的 Worklight 使用 Apache Cordova 并且使用 Android API 提供的 Web View 。

关于android - Android 上的工作灯性能不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14835184/

相关文章:

eclipse - 在 Worklight Server 6.1.0.01 上安装 war 文件

android - 使用 android 9 补丁文件不工作

android - 运行代码时应用程序图标不可见

Android 根据 "Parent"微调器的选择更新微调器 - .notifyDataSetChange() 未触发?

Android:ADB 更新 Google Play 服务 'Failure'

ios - 使用 WL.EncryptedCache.open 在 iOS 上延迟加载加密的本地存储

javascript - 图像文件夹中的图像未加载到 mobilefirst 中

javascript - 无法从同一文件调用 JavaScript 函数

android - 在数据库 SQLite(适用于 Android)中添加一个 txt 文件,怎么样?

javascript - IBM MobileFirst 客户端中未调用 handleFailure?