“Hundreds of devices…hundreds of variations…tens of browsers…plenty of device limitations. How do we develop a web application which works on all of them? How can we make out what are device specific settings before we render a web page. It’s a challenge. But, wait a minute. We have a savior. We have got User Agent.”
What is User Agent?
A User agent is a client application that communicates with the Web site or a server from a mobile phone using a Web browser.
When user requests a Web page, browser sends a number of headers to the server hosting the site that user is visiting. Each header contains details that help the server determine the best way to provide the information that user requested. The user-agent header identifies the application requesting the information from the server. The user-agent string can contain optional details called tokens, which must be enclosed in parentheses and vary among programs.
A sample user-agent string reported by BlackBerry 9630.
BlackBerry9630 /4.7.1.40 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/294
The string consists of the following fields:
Manufacture: Hardware [BlackBerry]
Model: model ID [9630]
Software version: software in the handset [4.7.1.40]
Profile: This data obtained from the Java Package [MIDP-2.0]
Configuration: Data obtained from the Java Package [CLDC-1.1]
User Agent Profile
User-Agent Profile is used for capturing wireless device information such as device capabilities and network setting via the mobile service network, so this information can be used by content providers to produce content in an appropriate format for specific devices. When a client visits a Web site or a server, a string is generally sent to identify the User-Agent Profile to the server. The intent of the User-Agent Profile is to capture more information about the User-Agent than can be described by the User-Agent header.
The communication flow of a User-Agent Profile is sent from the handset to the content server via the mobile service network and WAP proxy. The User-Agent Profile is sent from the handset as a URL referencing the User Agent Profile document storage location.
In order to format the content and verify User-Agent capabilities, the content server can download the
User Agent Profile information from the URL provided by the handset.
Below is a sub-section of the User Agent Profile information for the BlackBerry 9630:
<prf:PointingResolution>Character</prf:PointingResolution>
<prf:PixelAspectRatio>1x1</prf:PixelAspectRatio>
<prf:ScreenSize>480x360</prf:ScreenSize>
<prf:ScreenSizeChar>48x24</prf:ScreenSizeChar>
<prf:SoundOutputCapable>Yes</prf:SoundOutputCapable>
<prf:StandardFontProportional>Yes</prf:StandardFontProportional>
<prf:TextInputCapable>Yes</prf:TextInputCapable>
<prf:Vendor>Research In Motion Ltd.</prf:Vendor>
<prf:VoiceInputCapable>Yes</prf:VoiceInputCapable>
This example shows that a content server can determine that voice is supported by the handset, and voice may be included in the content being sent to the device.
Conclusion
The User Agent is useful and easy to use in identifying the client device that is connecting to a server.
This User-Agent data can be used for:
- Customizing content to suit the client device hardware capabilities (e.g. screen size).
- For re-directing the client to another server or page if content does not suit client.
- User Agent String ID can be used for tracking the number of times a client visits the site or a server in a given day or month.
- Determine if a handset has a MIDP1.0 or MIDP2.0 Java Virtual Machine, therefore ensuring that only supported Java applications are delivered to the device via OTA.
1 comments:
Good and Concise Information on user agent
Post a Comment