Android: Why user agent value is missing
this question is continuation to my开发者_开发技巧 previous question : How to set user agent for new ACTION_VIEW intent.
In my application I am launching a new Intent with url (browser) using the following code:
Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
try {
context.startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "cannot initiate Browser", e);
}
In the server side I see that some request headers containing "Apache-HttpClient/UNAVAILABLE (java 1.4)" as a user agent value.
Does anyone know if there any device, operator, browser or any other cause that will not sent the real user agent?
thanks -Z
This user agent string you wrote in the question is the default string set by the java apache http classes. So whatever browser you are using, it just did not set/change it.
Neither it's a device choice, nor operator. It's only a browser thing.
The default browser of Android will report sth like Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
精彩评论