在GWT中检测手机浏览器 [英] Detecting mobile browser in GWT

查看:85
本文介绍了在GWT中检测手机浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要为移动设备和个人电脑实施具有单独用户界面的Web应用程序。你知道我该如何检测它是否是移动的?一般来说,你有什么建议在GWT中实现这样的应用程序吗?

I want to implement a web application with separate user interface for mobile and PC. Do you know how can I detect whether it is mobile or not? In general, do you have any suggestion for implementing such application in GWT?

推荐答案

在客户端,你可以使用 Navigator class来获取平台和用户代理字符串:

On the client side, you can use the Navigator class to get the platform and the user agent string:

Navigator.getPlatform
Navigator.getUserAgent

以这种方式识别设备和平台。

Identify devices and platforms that way.

这篇关于在GWT中检测手机浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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