|
KamalPatel.net Back to Downloads/Articles |
Dealing with Wireless BrowsersBy Kamal Patel
BackgroundWML is a very good implementation of XML. The beauty of being an XML application is that extending the language is simply a matter of updating the DTD (Document Type Definition). This beauty also has a dark side associated with it. This dark side is that WAP specifications require that the vendors provide micro-browsers for a specific DTD on wireless clients. What does this mean? Well, when DHTML (Dynamic HTML) was added to the Microsoft’s Internet explorer we went to the right web site and downloaded the new browser, installed it and we were ready to go. Well, in wireless devices you are pretty much stuck with it… at least today. Till date applications for the web are written browser specific. This is because one browser supports some features and others do not. This is even worse in case of WML Browsers. Some devices support WML1.1, some will support WML1.2 but no WMLScript, some will support WMLScript with WML1.1. Some vendors have added features to the language, specifications that are not yet recognized by the Wapforum, making the applications vendor specific now. The combination is simply too extensive. Hence, in order to create wireless applications that work on multiple browsers, it becomes important to determine the type of browser being used and what is the device making the request. This article explains how we can determine the browser and device type. Determining the BrowserWhen a browser sends a request for any content to a web
server, the web server has a means to identify the browser through one of its
headers. The web server can achieve this by accessing the < %
‘Capture the ACCEPT string from the server variables
lcAcceptString = Lcase(Request.ServerVariables(“HTTP_USER_AGENT”))
‘Check if the ACCEPT string contains wml then redirect user to WML content
If InStr(lcAcceptString, “wml”) Then
Response.ReDirect(“Index.wml”)
Else
Response.Redirect(“Index.html”)
End If
% >
Determining the Type of DeviceAnother means of getting more device information is through the use of
ConclusionProgramming against user agents is a sad reality of life, at least today. With time, there will be more widely accepted common standards among devices and gateways. Currently the best approach to design WML applications is through the use of server side scripting technologies and applying XSLT templates to XML data for generating WML content. |