Android WebView and default browser with different UserAgent

Posted by Udi I on Stack Overflow See other posts from Stack Overflow or by Udi I
Published on 2012-12-19T11:02:11Z Indexed on 2012/12/19 11:02 UTC
Read the original article Hit count: 193

Filed under:
|
|

From some reason on several android devices, I'm getting different User Agent from the browser and from my application's WebView.

I have used this line of code to get the UA in the app:

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

This is the part with the difference

The application retruns:

HTC One X Build

While the browser returns:

HTC_One_X Build

Notice the underscores in the browser's version.

Any ideas what causes the difference?

Tx!

© Stack Overflow or respective owner

Related posts about android

Related posts about webview