PhoneGap 1.4 包装 Sencha Touch 2.X - 性能如何? [英] PhoneGap 1.4 wrapping Sencha Touch 2.X - What about performance?

查看:20
本文介绍了PhoneGap 1.4 包装 Sencha Touch 2.X - 性能如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个多平台平板电脑应用程序,并使用 Phonegap 1.4 仅使用其 web 视图来包装它,然后我使用 Sencha Touch 2 框架发挥了我的魔力.我所说的多平台是指 iOS 5.X+ 和 Android 3.0+(目前).

I'm building a multiplatform tablet app wrapping it with Phonegap 1.4 using just its webview, then I work my magic with the Sencha Touch 2 framework. By multiplatform I mean iOS 5.X+ and Android 3.0+ (for now).

到目前为止,这个应用程序运行良好,它的所有功能都可以在两个系统上运行,但是......在 Android 平板电脑(三星 GalaxyTab)上它真的很慢.发生了什么?我可以做些什么吗,还是只是安卓的限制?

This app is working great so far, all its features work on both systems but... On the Android tablet (Samsung GalaxyTab) its really slow. What's happening? Can I do something about it, or its just android's limit?

谢谢

Ricardo Perre:http://edgecodetechology.blogspot.pt/

Ricardo Perre: http://edgecodetechology.blogspot.pt/

****EDIT****(我试图让这篇文章对sencha社区有用)

****EDIT**** (I'm trying to make this post somewhat useful to sencha community)

Sencha Touch 与许多其他 Javascript 框架一样,由于 javascript 本身的原因,它并不是性能的最佳示例.

Sencha Touch, like many other Javascript Frameworks are not the best example of performance due to javascript itself.

那为什么要使用煎茶触控?

  • 就我而言:多平台(iOS、Android、Windows Phone、Blackberry、Windows、Mac OSX、Linux.共享 80-90% 的代码)莉>

缓解由于 Android 系统中缺乏可视化预处理而导致的性能问题:

  1. CSS3 繁重的视觉处理:

  • 避免渐变
  • 避免阴影
  • 避免变换和动画

良好的 MVC 实践:

  • 不要使用更多的视图,而您实际上是在展示
  • 尽可能预渲染/预取数据以避免同时处理渲染和数据

对于任何滚动视图,应在 Android 上禁用过度滚动.我已经在 Android 设备上测试了许多 Sencha Touch 2 应用程序,由于延迟和滞后,过度滚动会导致非常不愉快的体验.(在 Galaxy Tab、Nexus S 和一些 HTC 上测试)作者:Thiem Nguyen(我一直在挖掘你的帖子,对不起,伙计:P)

For any scrollviews, overscroll should be disabled on Android. I've tested many Sencha Touch 2 applications on Android devices and overscroll causes badly unpleasant experience because of delays and lags. (tested on Galaxy Tab, Nexus S, and some HTCs) by Thiem Nguyen (I've been mining your posts, sorry dude :P)

推荐答案

这里也一样.我已经在三星 GalaxyTab 上测试了我的许多 Sencha Touch 2 应用程序,性能真的很糟糕.有一个事实(这可能是实际原因的一部分),iOS 在渲染之前做了很多预处理和计算,以使用户的观感看起来更流畅,而 Android 倾向于渲染和渲染.随时随地同时处理.

Same here. I've tested many of my Sencha Touch 2 applications on Samsung GalaxyTab and the performance is really terrible. There's a fact (which maybe a part of actual reason) that, iOS does many pre-process and calculation before rendering to make it seems smoother to user's look and feel, while Android tends to render & process simultaneously on the go.

总的来说,可以说,对于每一个基于 Javascript 构建的跨平台移动应用程序,如 Sencha Touch,iOS 的性能都明显优于 Android.但是,Sencha Touch 开发团队正在尽最大努力改进这一点,希望在下一个版本中会更好.你可以看到这篇关于 iOS & 的文章Android 设备性能比较.

In general, it could be say that, to every cross-platform mobile apps built on Javascript, like Sencha Touch, iOS performance is significantly better than Android. However, Sencha Touch dev team is trying their best to improve this, hopefully it would be better in next releases. You could see this article about iOS & Android devices performance comparison.

http://www.sencha.com/blog/sencha-touch-2-开发者预览/

PS:虽然这与操作系统的限制密切相关,但您也可以优化您的应用,使其在 Android 设备上表现更好.根据我的经验,最佳做法是:

PS: While it's much relevant to the OS's limit, you can also optimize your app to make it perform better on Android devices. To my experience, the best practice is:

  • 不要过多地使用 CSS3.
  • 尽可能减少 DOM.

希望有帮助.

这篇关于PhoneGap 1.4 包装 Sencha Touch 2.X - 性能如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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