0
votes

User-Agent for iPhone Browser

Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7

User-Agent for iPhone App

Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X, en-us) AppleWebKit/532.9 (KHTML, like Gecko) Mobile/7D11.

I have tried to detect through "VERSION" keyword as in case of iPhone but it is not working in android Device.

1
which backend language you are using ?Satyen Udeshi
@satyen, I am using java..but just need sample user-agent for both android-app and android browser to differentiate among them.snow man

1 Answers

0
votes

You can do one thing. Set custom user-agent from application side.

DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, "android");

Check in request header if user-agent is "android" or "iphone" is from application and other-wise from browser.