有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (2) 个答案

  1. # 1 楼答案

    1您可以从userAgent字符串在客户端执行此操作

    String userAgent=request.getHeader(“User-Agent”);
    //Check it matches to respective user agents or not.
    

    比如:

    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
     // some code..
    }
    

    请参见:What is the best way to detect a mobile device in jQuery?

    2此处提供免费API:http://detectmobilebrowsers.com/

    3在这里您可以找到不同的方法:

    http://lotusmediacentre.com/find-http-request-source-computer-mobile-phones-or-tablets/

  2. # 2 楼答案

    这不是一个非常简单和直截了当的问题。您必须根据您拥有的资源和希望使用的平台提出一些基本想法,然后围绕该想法进行构建。你可以浏览下面的链接。基本上,这些链接会把你带到“如何检测移动设备”页面,这可以让你对你必须采取的方法和步骤有一些基本的了解

    这些链接可能有助于: Detecting mobile devices in a network

    Detecting mobile devices in a network