简体   繁体   English

如何有意义地检测低规格的移动设备?

[英]How to detect low-spec mobile devices meaningfully?

Right now I only know about Scientiamobile's WURFL and a few others. 现在我只知道Scientiamobile的WURFL和其他几个。 Those libraries or databases tell you quite a lot of things about the device but none of them can clearly indicate that you shouldn't use CSS transitions or other sorts of animation because even if the device supports it, its a complete different story that those features will run smoothly and this is my major concern when building mobile web apps. 这些库或数据库告诉你很多关于设备的事情,但没有一个能清楚地表明你不应该使用CSS过渡或其他类型的动画,因为即使设备支持它,它的完全不同的故事,那些功能这将是我在构建移动网络应用程序时的主要关注点。

Is it technically possible to 'classify' devices in this direction, using the 'WURF' database ? 从技术上讲,使用'WURF'数据库可以将设备分类到这个方向吗? And which device capabilities I should use to 'group' devices as 'fast' in terms of graphic power ? 在图形功率方面,我应该使用哪些设备功能将设备“分组”为“快速”?

Finally, I just need a rating of the device from 1-5 in order to decide which gfx operations I can use. 最后,我只需要从1-5开始对设备进行评级,以便决定我可以使用哪些gfx操作。

well, any thought is welcome. 好吧,任何想法都是受欢迎的。 It turns out as real brainer and the researches on internet didn't bring up anything useful except lots of data about device caps. 事实证明,除了大量关于设备上限的数据之外,互联网上的研究并没有带来任何有用的东西。

Update-1 : I just got a response from ScientiaMobile : "we have been playing around with the idea of some form of Javascript performance index (possibly based on one of the existing benchmarks) that could give some indication of that, but we are still not there yet. The problem is complex." Update-1 :我刚收到ScientiaMobile的回复:“我们一直在讨论某种形式的Javascript性能指标(可能基于现有基准测试之一)的想法,这可能会给出一些指示,但我们仍然还没有。问题很复杂。“

Update-2 : The biggest bottlenecks we discovered in mobile web apps Update-2 :我们在移动网络应用中发现的最大瓶颈

  1. animation power 动画力量
  2. PNG transparency PNG透明度
  3. text and box shadows 文字和框阴影
  4. image resizing 图像大小调整

For us its really enough to figure out that we need to disable those features as they can bring any application to its knees. 对我们来说,它确实足以弄清楚我们需要禁用这些功能,因为它们可以让任何应用程序瘫痪。 Possibly, there are also other approaches. 可能还有其他方法。

Thank you. 谢谢。

Unfortunately, I do not believe this is possible today for the general case. 不幸的是,对于一般情况,我认为今天不可能。

If you are only interested in a limited number of devices, of course you could test each and target those specifically via user agent or JavaScript-based detection. 如果您只对有限数量的设备感兴趣,当然您可以测试每个设备,并通过用户代理或基于JavaScript的检测专门针对这些设备。

Within the context of a thick app (eg, you "wrap" your web site with something like Apache Cordova ), it would be possible to provide JavaScript access to some of the device internals (eg, amount of total memory, amount of free memory, processor speed), but otherwise, this information is not available from the browser. 在厚应用程序的上下文中(例如,您用Apache Cordova “封装”您的网站),可以提供对某些设备内部的JavaScript访问(例如,总内存量,可用内存量) ,处理器速度),但除此之外,浏览器无法提供此信息。 As you've hinted at, having access to this type of device information may still be insufficient (eg, seemingly "high spec" devices that perform poorly). 正如您所暗示的那样,访问此类设备信息可能仍然不足(例如,看似“高规格”设备表现不佳)。

JavaScript feature detection libraries like Modernizr can answer whether something such as box-shadow and text-shadow is supported by the user's current browser, but does not provide information about how well or how quickly supported features will be rendered. Modernizr这样的JavaScript功能检测库可以回答用户当前浏览器是否支持 box-shadow和text-shadow等内容,但不提供有关支持的功能的呈现效果速度的信息。

Likewise, the datasets from Browserscope and related project ringmark (somewhat of a JavaScript analog to WURFL) answer these browser support questions on a per-browser-version basis through crowdsourced benchmarking tests (eg, does the iPhone support CSS3 transitions?), and for the general case, this is what would be necessary. 同样,来自Browserscope和相关项目ringmark (有点像JavaScript模拟WURFL)的数据集通过众包基准测试(例如,iPhone是否支持CSS3过渡?)以及每个浏览器版本来回答这些浏览器支持问题。一般情况下,这是必要的。 You would need to run a benchmark test for the various features in question and assess real-time performance. 您需要针对相关的各种功能运行基准测试并评估实时性能。 However, even this has its limitations: 然而,即使这有其局限性:

  • Because the necessary conditions for speed (available memory, processor, battery, network connection, etc.) are constantly in flux as mobile users move around, receive calls, change hardware settings, launch background applications, etc., the result of the benchmark is likely to be unreliable/unrepeatable. 由于移动用户四处移动,接听电话,更改硬件设置,启动后台应用程序等,速度(可用内存,处理器,电池,网络连接等)的必要条件不断变化,因此基准测试的结果是可能不可靠/不可重复。
  • Benchmarking takes time and will invariable add a (hopefully unnoticable) delay. 基准测试需要时间并且会不变地增加(希望是不可察觉的)延迟。
  • Depending on the feature, benchmarking may not be practical. 根据功能,基准测试可能不实用。
  • Features may behave differently in combination (eg, animating transparent PNGs with shadows) or at scale (eg, every image on the page is animating) than individually in the benchmarking test. 在基准测试中,特征在组合中可以表现不同(例如,使阴影具有动画透明PNG)或者在比例上(例如,页面上的每个图像都是动画)。
  • If you rely on benchmarking datasets instead of performing your own real-time benchmarking, the sample size, scope, and age of the dataset greatly limits its usefulness. 如果您依赖基准测试数据集而不是执行自己的实时基准测试,则数据集的样本大小,范围和年龄会极大地限制其有用性。

A final point is that I haven't even addressed is the fact that performance is rather subjective . 最后一点是我甚至没有解决的问题是表现是相当主观的 Say it were somehow possible to assess/predict the speed of an animation. 假设以某种方式可以评估/预测动画的速度。 If the animation will run at 15 fps, should the user see that animation? 如果动画将以15 fps运行,用户是否应该看到该动画? What about 5 fps? 5 fps怎么样? Who gets to be the ultimate arbiter that decides the threshold for whether or not a given feature performs well enough ? 谁成为最终仲裁者,决定某个特定功能是否表现良好的门槛?

The best advice I can offer today is to reduce (or eliminate) your reliance on the troublesome features for the time being. 我今天提供的最佳建议是减少(或消除)您暂时对麻烦功能的依赖。 It may seem terrible to suggest going back to "the old way" of using images with precomposed shadows or making background gradients without CSS3, but at the end of the day the user experience should take precedence over using the shiney new technology. 建议回到使用具有预组合阴影的图像或在没有CSS3的情况下制作背景渐变的“旧方法”可能看起来很糟糕,但在一天结束时,用户体验应该优先于使用闪亮的新技术。 Many mobile devices are simply not there yet, and neither are the detection methods. 许多移动设备根本就不存在,检测方法也不存在。 If you must use these features, perhaps consider a simple but unobtrusive way for users to opt-in/opt-out like Gmail's "standard" vs. "basic HTML" view options, or consider automatically doing the opt-in for known good browsers. 如果您必须使用这些功能,可以考虑使用简单但不显眼的方式让用户选择加入/退出,例如Gmail的“标准”与“基本HTML”视图选项,或者考虑自动选择加入已知良好的浏览器。

I can't add much more than 'user113215' already said. 我不能添加比'user113215'更多的内容。 Also its not an answer to the actual question but rather to the actual problem : 它也不是实际问题的答案,而是实际问题的答案:

I did experiment with a few users and we were using a simple welcome popup menu, asking the user to turn off special effects such shadows and animations. 我尝试了几个用户,我们使用了一个简单的欢迎弹出菜单,要求用户关闭特殊效果,如阴影和动画。 The most of the test users did appreciate the choice and clearly understood the means of such menu. 大多数测试用户都很欣赏这种选择,并清楚地理解了这种菜单的方法。 We do integrate this now more advanced and in conjunction with a hidden benchmark for auto pre-selection of GFX effects. 我们现在将此更高级整合,并与用于自动预选GFX效果的隐藏基准相结合。

Thank you. 谢谢。 g G

In short, no. 简而言之,没有。 How we define the smoothness of animations and graphics is solely depend on the FPS(frame-per-second). 我们如何定义动画和图形的平滑度完全取决于FPS(每秒帧数)。 And in this question we are talking about "web-app"s, which are making use of HTML and JS on the client-side. 在这个问题中,我们讨论的是“web-app”,它们在客户端使用HTML和JS。 Since none of the client side provide interface for the programs to get the FPS by HTML or JS, it is impossible to tell if the client is smooth or not. 由于客户端都没有为程序提供通过HTML或JS获取FPS的接口,因此无法判断客户端是否顺畅。

However, if you really want a benchmark on the performance of web-app. 但是,如果你真的想要一个关于web-app性能的基准测试。 You can make use of stats.js to monitor the change of stat and have a benchmark for you to suggest your client activating or disabling any sort of effects on runtime. 您可以使用stats.js来监控stat的变化,并为您建议客户激活或禁用任何类型的运行时效果。 This method even working with most FXs of Javascript libraries like jquery too. 这种方法甚至可以与大多数Javascript库的FX一起使用,例如jquery。 But this will take sometime for you to get enough data before applying changes and the stat may differ from the status of the device, such as memory usage, concurrent applications, etc. 但是,在应用更改之前,您需要一段时间才能获得足够的数据,并且统计信息可能与设备状态不同,例如内存使用情况,并发应用程序等。

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

相关问题 如何在servlet规范3中正确检测客户端断开连接? - How to properly detect a client disconnect in servlet spec 3? 如何检测电池电量低的时间:Android? - How to detect when the Battery's low : Android? 当box2d的数量超过300时,移动设备的性能非常低 - Very low performance on mobile devices when the quantity of box2d bodies is over 300 如何有意义地为java.lang.Class定义hashCode和equals <T> ? - How to meaningfully define hashCode and equals for a java.lang.Class<T>? 如何检测本地网络中的特定设备? - How to detect specific devices in a local network? 检测Java中的内存不足? - Detect low memory in Java? 在设备上未安装任何应用程序的情况下,通过低功耗蓝牙(即通过信标)向附近的移动设备发送通知 - Send notifications to nearby Mobile Devices through Bluetooth Low Energy(i.e. via beacons) with no app installed on their device 如何使用WS-Discovery规范在Java中发现网络上的ONVIF设备? - How to use WS-Discovery spec to discover ONVIF devices on a network in Java? Android:如何以编程方式检测Android设备中的Google登录弹出窗口 - Android: How to programatically detect google login popup in Android devices 如何在所有 android 设备上完美检测抖动水平? - How to detect shake level perfectly across all android devices?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM