Android Generic User Agent (UA)

前端 未结 5 1752
你的背包
你的背包 2020-12-31 12:27

I am building an Android app to display content feed from a server. The server is a mobile website (like http://m.google.com) which tracks the traffic from various mobile cl

5条回答
  •  北海茫月
    2020-12-31 12:59

    When you use the web view to access the user-agent, make sure you run the

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

    on the UI thread.

    If you want to access the user agent in the background thread. use

    System.getProperty("http.agent")

    To check whether a user-agent is valid or not use this https://deviceatlas.com/device-data/user-agent-tester

提交回复
热议问题