Android HTTP User Agent

后端 未结 4 1622
生来不讨喜
生来不讨喜 2020-11-27 13:58

How do I get the real device in http_user_agent? When I use a WebView, I can get the real value like this:

[HTTP_USER_AGENT] => Mozilla/5.0(Linux; U; And         


        
4条回答
  •  情歌与酒
    2020-11-27 14:06

    You can read useragent using webview:

    new WebView(this).getSettings().getUserAgentString();
    

    Or using system property:

    System.getProperty("http.agent")
    

    Source: https://stackoverflow.com/a/50610164/3317927

提交回复
热议问题