科尔多瓦/ PhoneGap的性能下降与全新的平板打开图层,但罚款的新手机 [英] Cordova/Phonegap slow performance with Open Layers on new Tablet, but fine on new phone

查看:106
本文介绍了科尔多瓦/ PhoneGap的性能下降与全新的平板打开图层,但罚款的新手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发出使用科尔多瓦/ PhoneGap的Andr​​oid上显示打开图层应用3张地图。

I have developed an application which uses Cordova/Phonegap on Android to display Open Layers 3 maps.

这是很类似这样的项目:

It is quite similar to this project:

https://github.com/netgis/ol3

我已经找到了应用程序运行流畅对三星注4运行奇巧V4.4.4,并运行在一个旧S2运行杰利贝恩(几乎同样出色事实上)的罚款,但它运行的非常慢慢麸皮新的Galaxy Tab 12.2临运行奇巧V4.4.2。

I have found that the application runs smoothly on the Samsung Note 4 running Kitkat V4.4.4, and runs fine on an old S2 running Jellybean (almost equally well in fact), but it runs terribly slowly on a bran new Galaxy Tab Pro 12.2 running KitKat V4.4.2.

我想知道是否有任何科尔多瓦/ PhoneGap的专家那里谁可能知道为什么。

I was wondering if there is any Cordova/Phonegap expert out there who might know why.

他们之间唯一的区别,我可以看到的是Android的版本! V4.4.4和V4.4.2。

The only difference between them that I can see is the version of android! V4.4.4 and V4.4.2.

我已经发现了SO螺纹,一般说的WebView可以是一个问题而导致性能下降,但我对我的注4得到了很好的表现,而S2的运行速度比平板电脑更好的使用它的Jellybean

I have discovered threads on SO which generically say that WebView can be a problem and cause slow performance, but I'm getting great performance on my Note 4, and the S2 runs better than the tablet does using Jellybean.

我不知道code将是有益的在这里显示,基本上我有一个与打开图层3的地图嵌入到一个单一的HTML文档科尔多瓦的Andr​​oid应用程序,仅此而已。

I'm not sure code would be useful to show here, essentially I have a Cordova Android application with a single HTML document with Open Layers 3 map embedded, that's it.

推荐答案

这个问题原来是与说谎的WebView,它使用默认的Andr​​oid浏览器。出于某种原因,这个浏览器限制CPU的支持,如果你正在尝试使用GPU加速(默认启用),但不提供GPU加速本身(这是真的很奇怪,但却是事实)。

The problem turns out to lie with WebView, which uses the default Android browser. For some reason this browser restricts CPU support if you're trying to use GPU acceleration (enabled by default), but doesn't provide GPU acceleration itself (it's really strange but true).

显然奇巧有之前的Andr​​oid V4.4.3这个问题。所以,如果你正在运行V4.4.4,因为它已经固定,你会不会遇到这个性能问题(因为它使用的,而不是默认的浏览器铬)。

Apparently KitKat has this problem prior to Android V4.4.3. So if you're running V4.4.4 you won't encounter this performance problem as it has been fixed (as it uses Chromium instead of the default browser).

下面是多次提到,我发现这证实这一之一:

Here's one of many references I've found which corroborate this:

HTTPS://$c$c.google。 COM / p /铬/问题/细节?ID = 315111

某些设备尚未更新到这个水平,这里有我的完全更新设备:

Some devices haven't yet been updated to this level, here are my completely up to date devices:

平板电脑采用Android V4.4.2

The tablet uses Android V4.4.2

该S2采用Android V4.0.2

The S2 uses Android V4.0.2

该注4采用Android V4.4.4

The Note 4 uses Android V4.4.4

该S2采用果冻豆,因此精细,注4使用更新后的奇巧,也运行良好,但平板电脑的应用程序的斗争,以这样的程度,这是因为它是低于V4.4.3无法使用。

The S2 uses Jelly Bean and is therefore fine, the Note 4 uses the updated KitKat and also runs fine, but the tablet struggles with the application to such an extent it is unusable owing to it being below V4.4.3.

对于我来说,大多数的SO建议的解决方案是禁用硬件加速,但这些建议不适合我的应用程序确实需要硬件加速来渲染效率地图。

For me, the majority of suggested solutions on SO are to disable hardware acceleration, but these suggestions are unsuitable as my application really does require hardware acceleration to render maps efficiently.

解决方案是通过强制使用铬不论OS版本通过使用人行横道的完全不搭这个问题了。

The solution is to take this problem away completely by forcing the use of Chromium irrespective of the OS Version through the use of Crosswalk.

有丰富的资源,我发现在人行横道协同使用科尔多瓦:

There are plenty of resources I've found to use Cordova in synergy with crosswalk:

https://crosswalk-project.org/documentation/cordova.html

https://blog.nraboy.com / 2014/10 /使用-人行横道离子型框架,Android的应用程序/

这篇关于科尔多瓦/ PhoneGap的性能下降与全新的平板打开图层,但罚款的新手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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