问题描述
我听到煎茶在一般情况下,通过使用JavaScript的这一事实,对Android设备的性能问题。
I am hearing that sencha in general, by the mere fact of using javascript, has performance issues on android devices.
我熟悉Android的WebView对象的限制,但我在想,如果这些性能要求有什么可取之处,特别是煎茶触摸2被淘汰。
I am familiar with limitations of the android webview object, but I was wondering if these performance claims have any merit, especially with Sencha Touch 2 being out
虽然我没有低端的Android设备,我一直在寻找通过煎茶触摸2画廊,找不到免费的Android应用程序很容易,因此,或许可以解释与煎茶触摸2在Android和你的经验并使其更快
Although I don't have a lower end android device, I was looking through the Sencha Touch 2 gallery and could not find free android apps very easily, so perhaps you can explain your experience with Sencha Touch 2 on Android and what you did to make it faster
推荐答案
据我的经验,到目前为止,还有一些关键点,为表现最好的可能的发展煎茶触摸2应用程序时要记住:
To my experience so far, there are some crucial points to keep in mind when developing Sencha Touch 2 applications with as best performance as possible:
-
要优化应用程序启动时间:
To optimize application startup time:
- 的COM preSS你的JS和放大器; CSS文件。删除任何未使用的JS功能或CSS混入(这可以很容易地通过SASS /北斗完成)。欲了解更多信息,请阅读本:http://www.sencha.com/blog/an-introduction-to-theming-sencha-touch
- 在加载外部JS文件动态,还有已经在这里一个很好的话题:What是正确的方式来加载外部JavaScript在煎茶触摸2
- Compress your JS & CSS files. Remove any unused JS functions or CSS mixins (this can be easily done through SASS/Compass). For more details, please read this: http://www.sencha.com/blog/an-introduction-to-theming-sencha-touch
- Load external JS files dynamically, there's already a good topic here: What is the proper way to load an external javascript in Sencha Touch 2
要优化应用性能:
- 让你的DOM结构尽可能的小。不活动的意见应该被销毁(动态,如果需要添加到您的容器后)。
- 避免使用过多的CSS3属性,因为它们是在Android设备上很慢。
- 对于任何scrollviews,overscroll应在Android上禁用。我已经在Android设备上测试了许多煎茶触摸2应用程序和overscroll原因,因为延误严重不愉快的经验和滞后。 (上的Galaxy Tab,Nexus S的,以及一些HTC的测试)
还有这里的话题是非常适合您的关注:
There's also a topic here which is quite relevant to your concern:
PhoneGap 1.4包装煎茶触摸2.X - ?什么效果
希望它帮助。
编辑年02月,第12届2014年:它已经近2年来,因为我张贴了这个答案(即超过3年,我一直在与煎茶触摸),我不得不说在Android的煎茶触摸性能黯然不可接受的。有时候我被卡在想,我不是完全掌握了最佳实践,但我认为这不是理由。或者至少,它会带我们几年来开发了大型煎茶触摸应用程序,它具有相同的外观和感觉作为本机应用程序,因为招数把我们这么多的时间。的
edited on Feb, 12th 2014: It has been nearly 2 years since I posted this answer (i.e. more than 3 years I have been working with Sencha Touch) and I have to say that Sencha Touch performance on Android is sadly unacceptable. Sometimes I was stuck in the thought that I'm not fully mastering the best practices, but I think it's not the reason. Or at least, it will took us years to develop a large-scale Sencha Touch app which has equal "look and feel" as native apps because the tricks take us so much time.
因此,在短裤,如果你是目标定位的iOS或您的应用程序是非常小的,没事的。但是,对于在Android大型应用,我个人不跟煎茶触摸。的
这篇关于煎茶触摸2机器人的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!