views:

704

answers:

3

Hi everybody,

I building an Https Client to send some data to a server, but I don't know what to pass in User-Agent. Should I use the webkit one's or do I have to build one explicitely for my App? I'm using this handy post Thanks for any help

A: 

you can send: "Mozilla/5.0 (Linux; U; Android 1.0; en-us; generic) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2" that's emulator user agent string

fazo
Apple/Safari on Android?
Vincent Van Den Berghe
I'll have a try with this and validate if it works. but if it's the emulator user agent string, what am I supposed to put if I want to publish my app?
Sephy
+1  A: 

You don't need to pass any User-Agent header, unless you're using a service that explicitly requires it such as for tracking or debugging purposes etc.

HTTP works perfectly well without the User-Agent header being present.

Christopher
A: 

I am looking for something similar.

I would like to be able on the server side to identify the Android platform version it's coming from and maybe also phone type and of course my own app version number.

Any hints on how to set the user agent to enable all of the above?

Erdal
you should find everything you need in the Build class, in android sdk
Sephy