为什么PhoneGap的比浏览器更慢? [英] Why is PhoneGap slower than Browser?

查看:202
本文介绍了为什么PhoneGap的比浏览器更慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑在Android上完全相同的Web应用程序下的PhoneGap,并在内置的浏览器。该应用程序的内置浏览器中运行良好,但PhoneGap的下令人难以置信的慢。即使是基本的滚动上的PhoneGap下页口吃。

I'm running the same exact web app on Android under PhoneGap and under the built in Browser. The app runs fine on the built-in browser but is unbelievably slow under PhoneGap. Even basic scrolling on the page stutters under PhoneGap.

这有什么,在一般情况下,我可能是做错了什么?我下了PhoneGap的只是使用相同的WebKit渲染器作为普通浏览器应用程序的IM pression,那么,为什么相同的HTML和JavaScript运行速度大幅减慢里面的PhoneGap?

Is there anything, in general, that I might be doing wrong? I was under the impression that PhoneGap just uses the same WebKit renderer as the normal Browser app, so why would the same HTML and JavaScript run much slower inside PhoneGap?

P.S。这已经过,但由于措辞,我认为原来的问题被误解了。

P.S. This has been asked before, but due to wording I think the original question was misunderstood.

推荐答案

我可能会在不经意间碰到了一个答案。事实证明了我工作的应用安卓targetSdkVersion AndoroidManifest.xml 设置为一个非常低的值(比如我的目标Android版是像2.2)。增加这 14 (安卓4.0)似乎有巨大的改进PhoneGap的表现,至少在运行ICS或果冻豆更新的Andr​​oid设备。

I may have inadvertently stumbled on an answer to this. Turns out that the apps I was working on had android:targetSdkVersion in AndoroidManifest.xml set to a really low value (i.e. my target Android version was something like 2.2). Increasing this to 14 (Android 4.0) appears to have hugely improved PhoneGap performance, at least on newer Android devices running ICS or Jelly Bean.

设置低 targetSdkVersion 似乎禁用至少有一些较新版本的Andr​​oid带来的性能提升。

Setting a low targetSdkVersion seems to disable at least some of the performance improvements introduced in newer versions of Android.

所以,如果你想看到PhoneGap的一个大的性能提升,请确保您的 targetSdkVersion 配以正在测试的手机所支持的最大SDK版本。

So, if you want to see a big performance boost in PhoneGap, make sure your targetSdkVersion matches the max SDK version supported by the phone you're testing on.

这篇关于为什么PhoneGap的比浏览器更慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆