Android mobile user agent?

前端 未结 4 1905
萌比男神i
萌比男神i 2021-01-01 18:16

I\'m currently making an android application for a forum, basically it just loads the website in a webview and that works fine and all, but I\'m trying to add an option to v

4条回答
  •  一生所求
    2021-01-01 18:32

    This is an example of user agent for android:

    Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

    And you can use simply:

    myWebView.getSettings().setUserAgentString("Android");
    

提交回复
热议问题