使用 Adobe Flex Builder 构建 iOS 应用程序 - 性能问题
我正在使用 Adobe Flex builder 构建一个 iOS 应用程序,并使用 Adobe 的工具将其编译为 .ipa。
通过初步测试,我发现最终结果并不像本机代码那样丰富,也不那么快速或流畅。
不要简单地说“为什么不直接使用 Objective-C”,是否有任何文档说明以这种方式构建应用程序的开销?
具体来说,当使用 Adobe 平台时,您预计会受到什么样的性能影响?
I'm building an app for iOS with Adobe Flex builder and compiling it into an .ipa using Adobe's tools.
Through initial testing, I see that the end result isn't as rich as native code, nor is it as fast or smooth.
Without simply saying 'why dont you just use objective-c', are there any documentation as to the overhead to building an app this way?
Specifically, what kind of performance hit can you expect when using Adobe's platform instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您使用的是最新的 AIR 3.0 SDK for iOS 打包。值得注意的是,它的性能更高。
开发应用程序时考虑最佳实践:
http://www.adobe.com/devnet /flash/articles/optimize_content_ios.html
http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc_2010.pdf
与原生 Objective-C 的全面比较是一个广泛的话题,Flash 无处不在的部署能力如果您的目标是 Android 和 BlackBerry,还应该考虑到多个平台。
也许引用您的实施中的具体问题将有助于产生洞察力。
Make sure you are using the latest AIR 3.0 SDK for iOS packaging. It is notably higher performance.
Consider best practices when developing your app:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc_2010.pdf
Blanket comparisons to native Objective-C is a wide topic, to which capability of Flash ubiquitous deployment to multiple platforms should also be considered if you're targeting Android and BlackBerry.
Perhaps citing specific issues of your implementation would help yield insight.
我也一直在开发基于 Flash 的 iOS 应用程序。我最初的原型在 iPad 1 中毫无用处。我必须寻找优化方法。我的第二个原型表现得很好。所以这里有一些提示。
1)不要使用定时器。我必须编写自己的实用程序“FrameWorker”单例类来管理和委托所有动画,甚至将操作延迟到单个 EnterFrame 事件。仅此一点就会给你带来巨大的速度提升。
2) 不要在不同的对象上使用多个enterFrame 事件。正如我在第一点所说的,找到一种方法来使用可以添加和删除进程的单个 EnterFrame。
3)尽可能避免矢量——使用图像。如果您需要在 Flash IDE 中或通过操作脚本绘制对象,请使用cacheAsBitmap = true。
4) 不要使用比屏幕面积大得多的视觉对象。如果您需要在屏幕上使用大型对象,请将它们从显示列表中管理出来,并学习位图传输技术,以便仅将当时将显示的矩形绘制到屏幕上。 Lee Brimlow 有一些很好的入门教程。
5) 管理活动时要严格遵守纪律。例如,请确保始终删除不再需要的侦听器。
6) 将应用程序的负载分配到不同的框架。不要在一个框架上做太多密集的事情。
如果您遵循这些指示,您的应用程序将与市面上的任何应用程序一样快。
I too have been developing a Flash-based iOS app. My initial prototype was useless in an iPad 1. I had to look for ways to optimize. My second prototype is performing quite well. So here are some pointers.
1) Don't use timers. I had to write my own utility "FrameWorker" Singleton class to manage and delegate all my animations, or even delayed actions to a single enterFrame event. This alone will give you a huge speed boost.
2) Don't use many enterFrame events on different objects. As I said on point one, find a way to use a single enterFrame that you can add and remove processes to.
3) Avoid vectors as much as possible-use images. If you need to draw objects in the Flash IDE or via action script, use cacheAsBitmap = true.
4) Don't use visual objects that are much larger than the screen area. If you need to use large objects across the screen, then manage them off the display list and learn blitting techniques to draw to the screen ONLY the rect that will be display at that time. Lee Brimlow has a couple of good starter tutorials.
5) Be very disciplined about managing events. Make sure you always remove listeners that are not necessary anymore for instance.
6) Distribute your app's load to different frames. Don't do too many intensive things on a single frame.
If you follow these pointers your app will be as fast as any out there.