简体   繁体   English

Adobe AIR在高分辨率Android设备上滞后

[英]Adobe AIR lag on high resolution Android devices

I have made an app which works well on iOS but has performance problems on Android. 我已经制作了一款适用于iOS但在Android上存在性能问题的应用。 I have noticed that on older devices such as galaxy s2 with a low screen resolution, the app is fine. 我注意到在较旧的设备上,例如具有低屏幕分辨率的galaxy s2,该应用程序很好。 It only lags on the new hd devices such as the galaxy s4 and nexus 4. 它只落后于新的高清设备,如galaxy s4和nexus 4。

Are high screen resolutions causing the devices to lag? 高屏幕分辨率会导致设备滞后吗? Does anyone know what I can do to find out how to fix this? 有谁知道我能做些什么来找出解决这个问题的方法?

It's really strange because it's only on the new devices. 这真的很奇怪,因为它只适用于新设备。

Not sure why it is happening on the S4 since it has a decent CPU and GPU, but high-density screens will cause lag, especially in Flash-based apps. 不确定为什么它会在S4上发生,因为它具有不错的CPU和GPU,但高密度屏幕导致延迟,尤其是在基于Flash的应用程序中。 I ran into the same problems when trying to move from the iPad 2 to the retina displays. 当我试图从iPad 2移动到视网膜显示器时,我遇到了同样的问题。

Let's look at it this way, with regards to the iPad issue I had. 让我们以这种方式看待它,关于我的iPad问题。 The iPad 3 bumped the resolution from 1024x768 to 2048x1536. iPad 3将分辨率从1024x768提高到2048x1536。 That is 4x as many pixels. 这是4倍像素。 Traditionally, Flash has issues rendering vector images. 传统上,Flash有渲染矢量图像的问题。 It is good at it, among the best, but it is slow. 它是擅长的,是最好的,但它很慢。 So rendering a vector object on the iPad 2 was only a 40x40 area to update. 因此,在iPad 2上渲染矢量对象只需更新40x40区域。 On the iPad 3, it is a 160x160 area to update. 在iPad 3上,更新为160x160区域。

Quick tips: 快速提示:

  • Never use CPU rendering. 切勿使用CPU渲染。 Stick to Direct (or GPU if you need to, but you lose features with GPU rendering, such as filters) 坚持直接(或GPU,如果你需要,但你失去GPU渲染功能,如过滤器)
  • Decrease the amount of vectors being used and how often you are changing them. 减少使用的向量数量以及更改它们的频率。 You should avoid, at all costs, updating vector objects every frame. 您应该不惜一切代价避免每帧更新矢量对象。
  • Make sure you are testing a release build (In Flash Builders, Project->Export Release Build...) when testing framerate issues. 在测试帧速率问题时,请确保您正在测试发布版本(在Flash Builders中,Project-> Export Release Build ...)。 It is generally much more evident on the iOS side than the Android side, but debug builds do cause lag iOS端通常比Android端更明显,但调试版本会造成延迟
  • Don't set the framerate higher than you have to. 不要将帧速率设置得比你高。 As the framerate goes higher, each frame has less time to run the necessary calculations. 随着帧速率的提高,每帧都有更少的时间来运行必要的计算。 The lag you notice isn't truly from low framerates (though that doesn't help), but more from dropped frames when a frame takes longer than available to render. 您注意到的延迟并非真正来自低帧速率(虽然这没有帮助),但是当帧花费的时间比可用渲染时间长时更多。 24 is the default, 30 is the standard. 24是默认值,30是标准。 60 is the max and is always nice, but it is completely unnecessary unless you are making a game. 60是最大值并且总是很好,但除非你正在制作游戏,否则完全没有必要。

I have several apps in production right now that run just fine on my Nexus 5, which is the same resolution as the S4 with roughly the same hardware, spec-wise. 我现在有几个应用程序正在生产,在我的Nexus 5上运行得很好,这与具有大致相同硬件的S4具有相同的分辨率。 Unless there is a problem with that hardware specifically, you should be able to manage 30fps no problem, if not 60. 除非特别是那个硬件有问题,否则你应该能够管理30fps没问题,如果不是60。

使用直接渲染模式adobe推荐。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM