如何使用wurfl检测台式机浏览器与移动设备? [英] How to detect desktop browser vs mobile device using wurfl?
问题描述
我计划在Web应用程序中使用Wurfl,以便区分移动设备和桌面浏览器. net.sourceforge.wurfl.core.utils中的isMobileBrowser(String userAgent)似乎是执行此操作的适当函数.
I am planning to use Wurfl in a web application in order to distinguish between mobile device and desktop browser. The isMobileBrowser(String userAgent) from net.sourceforge.wurfl.core.utils seems the appropriate function to do that.
尽管如此,查看1.0.1-rc3的源代码,我可以看到,如果用户代理字符串不包含"Tablet"字样,则它始终返回false.我正在阅读这篇文章 http://wurfl.sourceforge.net/newapi/,我想使用此处描述的模糊匹配来识别设备.可能是我使用了错误的功能吗?如果是这种情况,请您指出正确的方向吗?
Nevertheless looking at the source code of the 1.0.1-rc3 I can see that if the user agent string does not contain the "Tablet" word, it always returns false. I was reading this article http://wurfl.sourceforge.net/newapi/ and I would like to use the fuzzy match that is described there to identify the devices. Could be possible that am I using the wrong function?, if that is the case could you please point me to the right direction?.
还,您知道在哪里可以找到1.0.1-rc4的源代码吗?
Also , do you know where can I find the source code for the 1.0.1-rc4?.
推荐答案
您必须使用这些功能:
if(is_wireless_device=false and device_claims_web_support=true) {
the request is from web browser
}
这篇关于如何使用wurfl检测台式机浏览器与移动设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!