PhoneGap - 与 Android 上的浏览​​器相比性能较差 [英] PhoneGap - Bad Performance compared to Browser on Android

查看:33
本文介绍了PhoneGap - 与 Android 上的浏览​​器相比性能较差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 jquery mobile 和 phonegap 为 android 开发了一个应用程序.我通过 USB 将该应用程序部署到我的设备上.该应用的性能非常糟糕,尤其是在滚动较长的列表时.

I developed an application for android using jquery mobile and phonegap. I deployed the app to my device over usb. The performance of the app ist really bad, especially while scrolling a longer list.

奇怪的是:如果我只是在手机上打开浏览器并直接访问 index.html,整个应用程序运行起来很流畅.同样的技术,同样的内容.我不使用 phonegap 原生 api 或任何类似的东西.

The strange thing is: The whole app runs smooth if i just open up the browser on my phone and access the index.html directly. Same technology, same content. I do not use the phonegap native api or anything similar.

在 android 4.0.2 上使用 phonegap 1.5.0 和 1.7.0rc1、jquery mobile 1.1.0 进行测试.

Tested with phonegap 1.5.0 and 1.7.0rc1, jquery mobile 1.1.0 on android 4.0.2.

有什么想法吗?

推荐答案

在蜂窝 (3.0)、冰淇淋 (4.0) 和后置设备上,您可以通过在 < 中添加以下内容来提高性能.应用程序...> 标签:

On honeycomb (3.0), Ice cream (4.0) and posterior devices, you can boost performance by adding the following in the < Application ... > tag:

android:hardwareAccelerated="true"

您可以将 minSdk 设置为 8 (Android 2.2) 以实现兼容性,将 targetSdk 设置为 15 (Android 4.0),这将使硬件加速仅在设备上可用.

You could set the minSdk to 8 (Android 2.2) for compatibility and the targetSdk to 15 (Android 4.0) and that would make hardware acceleration work when its available on the device only.

我相信有了这个标志,我的应用程序的性能就等于在浏览器中运行它们,所以我猜这是因为浏览器是用硬件加速编码的:)

I believe that with this flag the performance of my apps is equal to running them in the browser, so I guess its because the browser was coded with hardware acceleration :)

这篇关于PhoneGap - 与 Android 上的浏览​​器相比性能较差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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