How to get the default HTTP USER AGENT and its default settings from the android device?

thanks  

Nohsib
['https://Stackoverflow.com/questions/6824604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/530993/']
**Edit: See Prakash's answer, which is better for 2.1+.**

Try <http://developer.android.com/reference/android/webkit/WebSettings.html#getUserAgentString>

Note that this User Agent will only apply for the embedded WebKit browser that's used by default in Android. Unfortunately, you'll need to create a new WebView object to get the user agent. Fortunately, the user agent doesn't change often, so you should only need to run this code once in your application lifetime (unless don't care about performance). Just do:

```
String userAgent = new WebView(this).getSettings().getUserAgentString();

```

Alternatively, you can use the JavaScript method `navigator.getUserAgent()`.
An alternative

```
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
    String userAgent = WebSettings.getDefaultUserAgent(context);
}

```