Could someone tell me where "default android user agent string" is defined in?
Asked
Active
Viewed 3,066 times
1
-
See [this][1] question. [1]: http://stackoverflow.com/questions/3904467/android-http-user-agent – kgiannakakis Apr 10 '12 at 08:25
-
Thanks for your information, but i want to know where is the initial user agent string defined in? Do you have any other idea? – Liverpudlian Apr 11 '12 at 06:25
3 Answers
1
WebView is equipped with user agent string. You can get or set it for your WebViews manually too.
/* for example */
//get
String ua = webview.getSettings().getUserAgentString();
//set
webview.getSettings().setUserAgentString("your custom user agent string");

waqaslam
- 67,549
- 16
- 165
- 178
-
Thank you for your information, but i want to know that where is the default value of user-agent string, or where does the method getUserAgentString() get this value from? – Liverpudlian Apr 11 '12 at 07:23
-
sorry, no idea... perhaps you can make a search on system files if your phone is rooted – waqaslam Apr 11 '12 at 07:45
0
Trying something if you want your Webview to report a non-default user agent. The user agent can vary from application to application.
myWebView.getSettings().setUserAgentString("Android");

Kumar Bibek
- 9,016
- 2
- 39
- 68

suraj jain
- 1,012
- 14
- 26
-
Yes, we could use setUserAgentString() set that value. But my point is where is the default value of user agent string defined in? As the information from my searching, the initial value of user agent string is web_user_agent_target_content, but i can not find where did it declare in android source code? – Liverpudlian Apr 11 '12 at 06:21
-
What exactly do you want to achieve? Are you building a custom rom or something? – Kumar Bibek Jul 19 '12 at 13:44