如何使用JSP / Java来检测手机(iOS和Android)? [英] How to detect mobile (iOS and Android) using JSP/Java?

查看:372
本文介绍了如何使用JSP / Java来检测手机(iOS和Android)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道如果任何人有碰到过这个?

Just wondering if anyone has come across this?

基本上,即时通讯寻求检测的iOS和Android使用JSP,并能够有条件CSS和JS文件添加到页面。

Basically, Im looking to detect for iOS and Android using JSP and to be able to conditionally add CSS and JS files to the page.

任何想法?

推荐答案

最好的办法很可能是与用户代理字符串。实际上,有一个pretty类似的问题已经SO,至少适用于iOS / Safari浏览器。请注意,有iOS上的其他浏览器,所以你需要寻找自己的用户代理字符串为好。

Best way would probably be with the User Agent string. There's actually a pretty similar question on SO already, at least for iOS/Safari. Note that there are other browsers on iOS so you will need to look for their user agent strings as well.

UA的金润串上市本网站

<一个href=\"http://stackoverflow.com/questions/186734/how-do-i-detect-mobile-safari-server-side-using-php\">How我使用PHP检测移动Safari浏览器服务器端?

这篇关于如何使用JSP / Java来检测手机(iOS和Android)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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