我到处找。我们正在使用摩托罗拉 Zoom 来尝试我们的平板电脑站点测试。 问题是安卓用户代理是一个通用的用户代理,平板安卓和移动安卓没有区别。我不想只针对 Xoom Useragent 这样的特定设备,因为在不久的将来,Android 很可能会出现在多台平板设备上。
我们正在使用 Umbraco CMS,我们已经研究过使用 51Degrees.mobi 解决方案,目前这无法满足我们的需求。或许在将来。我知道 51Degrees 和 Umbraco 的一些人将会对 Umbraco 进行一些整合,但最终的项目可能要几个月才能完成。
因此,我们为什么要检测 Android 平板电脑的 Useragent 字符串,而不是像现在这样直接访问我们的移动网站。
如果有人知道如何检测一般的 Android 平板电脑,则不是特定设备会很有帮助。
最佳答案
The issue is that the Android User-Agent is a general User-Agent and there is no difference between tablet Android and mobile Android.
这是不正确的。移动 Android 在 User-Agent header 中有“Mobile”字符串。平板电脑 Android 没有。
但值得一提,有不少平板电脑在 userAgent 中报告“Mobile”Safari,而后者并不是唯一/可靠的区分方式在手机和平板电脑之间。
关于android - 一般如何检测 Android 平板电脑。用户代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5341637/