Wednesday, April 23, 2014

Android application development is how to modify the http request header User-Agent


Android application development is how to modify the http request header User-Agent: http example android2.2 in the User-Agent is Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91 ;) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safafi/533.1 \ r \ n
How to change it to Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91; csdncsdncsdncsdncsdncsdncsdncsdn) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safafi/533.1 \ r \ n This is just playing an example, you can modify some of his string, append! I am afflicted, hope you save! Tell me passing through, help inform it, appreciate it!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
webView can setUserAgentString
 
mwebView = new WebView (mContext);
WebSettings set = mwebView.getSettings ();
set.setUserAgentString (SmartConfig.getWebUserAgent (mContext));

Reply:
Will solved yet

No comments:

Post a Comment