Book
Review

Programming Applications
with the Wireless Application Protocol

Author: Steve Mann
Hardcover, 256 pages
Published by: John Wiley & Sons, Inc., December 1999.
ISBN: 0-471-32754-9

Review by Kostas Pentikousis

The Wireless Application Protocol (WAP) is an attempt to define an industry-wide specification for developing applications that operate over wireless networks. The WAP Forum, an industry association which counts more than 500 members (www.wapforum.com), issues the specifications [3] for a protocol stack and application environment that allows a broad class of devices to communicate efficiently over wireless networks. The WAP Application Environment (WAE) [4] includes a microbrowser specification, the wireless markup language (WML) [5], a scripting language (WMLScript) [6], and a framework for wireless telephony applications. Moreover, WAE assumes that there is always a proxy server (often called a WAP gateway) between the client and the server that translates from WAP to Internet protocols and vice versa. That is, the (wireless) client communicates with the WAP gateway using the WAP protocol stack, while the WAP gateway uses TCP/IP to communicate with the server (often called origin or content server).

"Programming Applications with the Wireless Application Protocol" by Steve Mann is mainly an introduction to application development for the WAP domain. The author introduces the application framework provided by WAP in the first chapter. I found the sections about the device characteristics and the comparison between the web and the WAP programming models very enlightening. The comparison is useful because it is important for the developer to understand what the purpose of WAP is and what it isn't. For example, WAP has been marketed, especially in the western world, as the "wireless Web." This is not true, not only because there are alternative proposals for the "wireless Web," but also because this goes against the very philosophy of WAP, at least in the current incarnation. As Mann notes, the "WAP user paradigm is one where users are able to make small, specific, focused requests for small chunks (typically less than 1000 bytes) -- not browse random Web sites."

The book serves as a good introduction to WML and WMLScript, highlighting the key points. WML is presented in the second chapter of the book. Mann covers all the main characteristics of this markup language thoroughly, providing several examples of WAP pages (called "WML decks"). The CD-ROM that comes with the book contains all the code listings included in the text. I found the CD-ROM handy, and the chapter rather complete, so in most practical cases one does not need to refer to the WML specification [5].

WMLScript, presented in chapter 3, is a scripting language derived from ECMAScript [2] that complements WML by adding logic to WAP applications. In the beginning of the chapter, the author explains clearly the differences between WML and WMLScript. WMLScript is a function-oriented language: there is no main procedure, but a set of functions. The functions are stored in source form at the content server just like JavaScript programs. However, unlike JavaScript [1] programs, which are both compiled and run at the client, WMLScript functions are compiled at a WAP gateway, and are then delivered in byte-code format to the wireless device for execution. This saves battery energy and results in less bandwidth waste. Wireless phones have typically limited CPU power so compiling WMLScript functions at the WAP gateway is also time efficient. The chapter includes a demo application, namely a single-player implementation of the game Battleship, which illustrates all the important parts of a WAP application that utilizes both WML and WMLScript. The author does not simply list the application code but explains the design choices and program development options. However, in an attempt to make it easier for the reader to understand the main points of a WAP application, the author created a rather trivial application. Last but not least, the chapter introduces the WMLScript standard libraries [7].

In chapter 4, Mann analyzes WorldFAQ, a dynamic content WAP application based on a Java servlet that provides a variety of "tidbits" about a given city. The book does not cover Java or Java servlets and the reader is referred to the literature for more on these subjects. Nevertheless, if the reader is familiar with any programming language they would probably understand everything presented in this chapter. Note that the WAP Software Developer's Kit (SDK) by Phone.com - formerly known as Unwired Planet (UP) - offers Perl and C libraries similar to the Java library presented in this chapter. Mann gives the long code listing of the application and explains some parts a little bit more. The servlet is a rather simple program but demonstrates the salient points of WAP application programming. If you are familiar with CGI programming this chapter may be of little use; this is an introductory book after all. The author admits that the application is simple and has some flaws, e.g. it uses a plain text file for the city information database, but argues that simplicity is needed in order to focus on the WAP part of the application.

In general, the book contains a good starting set of references, including international standards and Internet RFCs, and the reader is frequently referred to these for more information and details. This is a good practice; the sources are the best reference. On the other hand, many readers might look for more from a book that claims to be "the complete developer's guide". Despite the book's subtitle, Mann does not cover every aspect of WAP programming in depth. Some readers may find the book shallow and of little use when they start creating complicated applications. Others, who are familiar with web programming, may want to skip some chapters altogether. For example, chapter 5 explains issues related with caching. In a limited bandwidth environment caching may enhance the user experience. Caching is discussed in this chapter in the context of WAP applications, yet if the reader is knowledgeable about HTTP [8] they will not get much out of this chapter.

Chapter 6 presents graphics and multipart responses. Using graphics in a low-bandwidth, high-latency environment can have a big impact on the user experience. Graphics take a lot more time to download, which can translate to unhappy users. On the other hand, graphics save valuable display real estate. The developer must make an intelligent choice between using graphics or text. Mann explains, for example, that with effective use of caching, images can be downloaded once to the user agent and then used over and over again. For example, in the WorldFAQ application some images are downloaded in the "splash" screen and then used by several different decks. Effective use of cache can lead to good user experience: better and more informative presentation and smaller delays.

Another solution to enhance the user experience is the use of multipart documents. Typically, a client will issue a request for a WML deck, and then will issue separate requests for the images contained in it. For example, assume that a user types in the URL of a deck that contains three images. The microbrowser will first fetch the WML deck, and when the deck is received, it will issue requests for the three images. With multipart documents the server can send along with the deck the corresponding images, and save at least a request-response cycle. The main idea here is that if you will definitely send three images along with a page, why wait for four different requests? Send everything at once and limit the overall delay. Unfortunately, this approach does not work well with caching.

Chapter 7 covers internationalization (or I18N), that is the procedure of adapting a program to serve content in multiple languages simultaneously. The author briefly describes transfer encodings, and presents a WAP application that allows for displaying different content depending on the language (multilingual content servers). Another way of dealing with I18N is to utilize a web server (like Apache, www.apache.org) that is able to do content negotiation as specified in HTTP/1.1 [8]. The latter approach is probably more efficient.

Overall, the book is well written, and has only a few errors. It is also easy to read: one can read it cover-to-cover in a day or two. The CD-ROM also contains a SDK from Phone.com, but one can easily download a more recent version from www.phone.com. Another consideration is that the book covers mainly Phone.com products. For instance, the author uses the UP browser for all examples, and although he mentions the potential problems that can arise from the different renderings of content in other browsers, he does not give examples per se. Moreover, in the last chapter the author presents some functionality that the Phone.com gateway has but glosses over the functionality provided by other gateways. The two extensions to WAP presented in the last chapter are notification and nested contexts. It would be more useful if the book included a case study with different browsers and the rendering they do to the same WML deck.

In conclusion, this is a good introductory text on WAP application programming, providing a good set of examples for WML and WMLScript. If you are not very familiar with the web programming paradigm you will find this book very informative. If you are familiar with web programming, then maybe you should refer straight to the documentation available for free at the WAP Forum web site [3].

References

1
D. Flanagan, JavaScript: The Definitive Guide, 3rd edition, O'Reilly & Associates, Inc. 1998.
2
ECMA, ECMAScript Language Specification, November 2000. http://www.ecma.ch/ecma1/stand/ecma-262.htm
3
WAP Forum, WAP Forum Specifications, http://www.wapforum.org/what/technical.htm, November 2000.
4
WAP Forum, Wireless Application Environment Overview (version 1.3), http://www1.wapforum.org/tech/documents/WAP-195-WAEOverview-20000329-a.pdf
5
WAP Forum, Wireless Markup Language Specification (version 1.3), http://www1.wapforum.org/tech/documents/WAP-191-WML-20000219-a.pdf
6
WAP Forum, WMLScript Language Specification (version 1.2), http://www1.wapforum.org/tech/documents/WAP-193-WMLScript-20000324-a.pdf
7
WAP Forum, WMLScript Standard Libraries Specification (version 1.3), http://www1.wapforum.org/tech/documents/WAP-194-WMLScriptLibs-20000324-a.pdf
8
World Wide Web Consortium, Hypertext Transfer Protocol (http://www.w3.org/Protocols/), November 2000.

Last Modified:
Location: www.acm.org/crossroads/xrds7-2/progwap.html