如何发现Android平板电脑一般。用户代理? [英] How do detect Android Tablets in general. Useragent?

查看:191
本文介绍了如何发现Android平板电脑一般。用户代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过无处不在。我们使用的是摩托罗拉变焦尝试我们的平板电脑现场测试。 问题是,Android的用户代理是一个普遍的UserAgent并有Android的平板电脑和手机的Andr​​oid没有什么区别。我不希望只是针对像Xoom的用户代理的特定设备,因为Android将最有可能在不久的将来,多个平板设备。

我们使用的是一把umbraco CMS,我们已经看过用51Degrees.mobi的解决方案,而这时我们的需要,这将无法正常工作。也许将来。我知道51Degrees和一些人一把umbraco都将做一些集成到一把umbraco,但最终的项目可能不会缺阵几个月。
因此,我们为什么要检测Android平板电脑的用户代理字符串,并将它不是直接到我们的移动网站像它目前是。

如果有人知道如何检测和Android平板一般,而不是特定的设备将是非常有益的。

解决方案
  

问题是,Android的用户代理是一般用户代理和有平板电脑Android和Android的手机没有什么区别。

这是不正确。移动Android已经在User-Agent头移动的字符串。平板电脑Android不。

I have looked everywhere. We are using a Motorola Zoom to try our tablet site testing. The issue is that the Android Useragent is a general Useragent and there is no difference between tablet Android and mobile Android. I don't want to just target a specific device like the Xoom Useragent since Android will most likely be on multiple tablet devices in the near future.

We are using Umbraco CMS, and we have looked at using the 51Degrees.mobi solution, and at this moment this will not work for our needs. Maybe in the future. I know 51Degrees and some of the people at Umbraco are going to be doing some integration into Umbraco, but the final project will probably not be out for a couple of months.
Hence, why we would like to detect the Useragent String of an Android tablet and have it not direct to our mobile site like it currently is.

If anyone knows how to detect and Android Tablet in general, not the specific device would be very helpful.

解决方案

The issue is that the Android User-Agent is a general User-Agent and there is no difference between tablet Android and mobile Android.

This is incorrect. Mobile Android has "Mobile" string in the User-Agent header. Tablet Android does not.

这篇关于如何发现Android平板电脑一般。用户代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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