如何检查设备是否足够快 [英] How to check if device is *fast* enough

查看:60
本文介绍了如何检查设备是否足够快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到比我的问题更好的措辞了.

I can't find any better wording to my question.

在我的应用程序中的某个时候,我已经设置了一些非常密集的动画.问题是,在高端设备上,动画运行流畅且令人愉悦.另一方面,我测试过的一个低端设备在制作动画时的性能相当差.

At some point inside my app I have set up some pretty intensive animation. Thing is, on high-end devices the animation runs smoothly and is pleasant to the eye. On the other hand, one low-end device I tested had a pretty bad performance while animating.

尝试将用户体验放在首位,我想在计算能力足够的设备上运行这些东西,并以某种方式在其他设备上关闭".

Trying to put user experience first, I'd like to run this stuff on devices that are computationally sufficient, and somehow "turn it off" on other devices.

我已经思考了一段时间如何区分设备.我唯一想到的就是API级别:考虑到平台分散和制造商的延迟,我相信API级别和性能之间应该存在某种关联.但是可能会有更好的结果.

I have thought for a while on how to discriminate between devices. The only thing that comes to my mind is API level: considering the platform fragmentation and manufacturers delays, I believe there should be some kind of correlation between API level and performance. But there might be something better.

你有什么主意吗?

请澄清一下,动画是我无法以任何方式简化或简化的(例如,使用较小尺寸的可绘制对象,质量较差的位图等).主要是测量和布局的东西.

Just to clarify, the animation is not something I can lighten or simplify in any way (e.g., using smaller size drawables, worse quality bitmaps, .... ). It's mainly measuring and layout stuff.

请随时编辑我选择的标签.

Please feel free to edit the tags I chose.

推荐答案

首次运行应用程序时,您可以运行某种微型基准测试,该基准测试可以测量CPU性能的时间不超过一两秒钟.我建议不要自动禁用动画,但是会警告用户设备是否运行缓慢,并询问他们是否要禁用它们.

The first time your app runs, you could run some kind of micro-benchmark that would measure the CPU performance for no more than a second or two. I would suggest not disabling the animations automatically, but warn the user if the device seems slow and ask if they'd like to disable them.

这篇关于如何检查设备是否足够快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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