WAP is a standard for mobile Internet applications. Its primary objective is to provide an open standard for optimized access via a mobile device to the Internet or intranet.
When first introduced, WAP was touted as a revolutionary technology that would totally transform the world of mobile computing. But WAP and WAP-based services couldn’t completely facilitate such transformation due to limitations of mobile devices and mobile networks, such as:
- Small screens
- Limited device memory
- Less powerful CPUs
- Limited bandwidth availability
- Unreliable connections
- High latency
However, there are changes on the horizon for WAP in the form of WAP 2.0. In this article, I will give an overview of WAP and how it uses WML to display content. I will also explain how WAP 2.0 improves on 1.x’s features, but why you might need to continue using the 1.x standards for now.
How WAP works
When accessing a Web site from a browser on a desktop PC, the client requests data and the server sends that data in the form of HTML over an IP network. The Web browser translates the HTML data into viewable text and graphics.
On your mobile device, WAP replaces a Web browser with a WAP browser, which can also request data from a Web site. The major difference between how you access the data via a browser on your PC and a WAP 1.x browser is that the WAP browser requires a WAP gateway. This gateway functions as an intermediary between the mobile and Internet networks. When placed between a WAP browser and a Web server, it takes care of the necessary binary encoding of content and can also translate WML to/from HTML.
Why you should use WAP
Despite initial concerns about mobile limitations, there are many good reasons to use WAP to implement mobile Web browsing.
- WAP has its own security model that works on lines very similar to Web security. Hashing algorithms, digital certificates, and public key cryptography provide the critical security required for any real transactions using WAP.
- WAP development is pretty simplistic. WML and WMLScript provide for almost everything that a mobile Internet application would need. The learning curve for WML or WMLScript isn’t very steep; most programmers can pick it up rather quickly.
- WAP is widely accepted. Major players in the wireless market (like Nokia, Motorola, and Ericsson) are all very active participants in the WAP process.
- WAP is standard independent. So even a switch to a GPRS network wouldn’t really make a difference when browsing. Only better data transfer speeds would contribute to a better browsing experience.
WAP and WML
Wireless Markup Language (WML) is an integral part of the WAP architecture (see Figure A). WML is a markup language based on XML that was developed and is maintained by the WAP Forum.
WML is actually well formed XML that adheres to predefined rules. It uses display tags to present content in a form suitable for mobile devices. In an ideal situation, the Web server dishes out WML content solely to be displayed on WAP browsers. A number of WAP gateways can also translate HTML to WML. However, you shouldn’t rely on this feature, because it won’t really provide a truly accurate WAP display.
WAP 2.0 brings new standards
With version 2.0, WAP moved toward adopting widely accepted Internet standards. The W3C-defined XHTML Basic standard has been adopted as the basis for WAP 2.0. XHTML Basic is the mobile version of XHTML 1.0, on which the WAP Forum based its XHTML Mobile Profile.
WAP CSS is the mobile version of cascading style sheets (CSS) that has only those features of CSS that are relevant to the mobile environment. XHTML and CSS puts more formatting power in the developer’s command. Using XHTML and CSS, you could even display the same document on different devices using distinct presentation capabilities. WAP 2.0 also includes WML 1.x extensions to ensure backward compatibility.
With WAP 2.0, the gateway is no longer that critical a component of the WAP architecture. Also, content no longer needs to be binary encoded; XHTML goes through in text format. However, because many people still rely on mobile devices that require the WAP 1.0 standard, and because the WAP/WSP stack is being used for transport, you will still need to support WAP 1.0 gateways.
So even though WAP 2.0 offers a formidable set of features, you should probably play it safe in your current development and stick with the 1.x standards for the time being.