Thursday, June 1, 2023
Tuesday, April 7, 2009
What is WURFL?
WURFL focuses on the problem of presenting content on the wide variety of mobile devices. The
Luca Passani is the driving force behind WURFL and you can find more information about WURFL on http://wurfl.sf.net .
The above info were obtained by http://www.wikipedia.com/
Wednesday, April 1, 2009
Finding the User Agent
In this post we will find out how can we optain the UA name.
If we are talking about a web browsers client the info about UA can be optained from http headers in many server environments. Below we will quote examples for the major scripting languages:
1. PHP
In PHP, the value of HTTP headers are stored in the $_SERVER array. Here is the code for retrieving HTTP headers:
$user_agent = $_SERVER["HTTP_USER_AGENT"];
$user_agent contains the UA name and version.
2. Perl
In Perl, the values of HTTP headers are stored in the %ENV hash. Here is the code for retrieving HTTP headers:
$user_agent = $ENV{"HTTP_USER_AGENT"};
Again $user_agent contains the UA name and version.
3. Javascript
In JScript, the code for reading HTTP headers should look like this:
var user_agent = Request.ServerVariables("HTTP_USER_AGENT");
user_agent contains the UA name and other info.
4. In Java Servlet or JSP, you can use the getHeader() method of the javax.servlet.http.HttpServletRequest object to retrieve the value of HTTP headers. Here is the code for reading HTTP headers:
String user_agent = request.getHeader("user-agent");
user_agent contains the UA name and other info.
5. In ASP, you can use the ServerVariables collection of the Request object to retrieve the value of HTTP headers.
user_agent = Request.ServerVariables("HTTP_USER_AGENT")
In the next post we will find out how to detect the Client Device Capabilities.
Tuesday, March 24, 2009
What is user agent?
According to Wikipedia a user agent is the client application used with a particular network protocol; the phrase is most commonly used in reference to those which access the World Wide Web. Other systems, such as Session Initiation Protocol (SIP), use the term user agent to refer to both end points of a phone call, server and client.
Web user agents range from web browsers and e-mail clients to search engine crawlers ("spiders"), as well as mobile phones, screen readersand braille browsers used by people with disabilities. When Internet users visit a web site, a text string is generally sent to identify the user agent to the server. This forms part of the HTTP request, prefixed with User-Agent: (case does not matter) and typically includes information such as the application name, version, host operating system, and language.
To put it simple in a mobile phone the user agent (UA) you are using to browse the Internet is your mobile phone browser. In most cases this client is user to view received MMS also.
In the next post we will discuss about how can we lean which user agent we are using and what does this mean.
If you have any comments please feel welcome to post them.