Full-house, Go-Fish, and Blackjack – some of my favorite games to play when I’m with friends. Alright, maybe that’s not true, but they’re definitely a way to pass the time. The words “deck” and “card” are synonymous to playing cards. However, they are also the terms used when developing WAP-enabled websites using WML. In this tutorial, I’ll give a breakdown on just what WAP and WML are and how they can be used. We’ll also run through creating a simple WAP-enabled site making use of multiple cards in a deck. There will be ample code to get you started on developing your own WAP-enabled site, whether for fun or for business.
<p>Welcome to our first WAP-enabled page. We're using WML1.3 to construct this deck of cards!</p>
In the example above, we created a simple single-card deck that, when executed, will display a welcome message to our device. As you can see, WML is very similar to HTML – most WML tags are derived from HTML. We open our document with an XML declaration, followed by the location to the DTD we’ll be modeling our page after. If you’re unfamiliar with XML documents and/or DTDs, feel free to read one of our XML tutorials. Next, we open our deck using the <wml> tag. To create our card, we use the <card> tag, and simply make use of a couple of HTML tags, including the <big> tag to increase the font size, as well as our standard paragraph (<p>) tag.
Here’s what the output would look like:
In case you’re wondering what type of cell phone I’m using, I’ll take this time to introduce a development environment suited for WML: Openwave SDK. Openwave is a company providing open software products and services for the mobile market. Here’s a snip from their website:
"Openwave products include phone software, multimedia messaging, Email, location, device management and mobile gateways. As one of the foremost innovators and market leaders in the mobile field, Openwave has gained worldwide experience and deep industry expertise.
"Openwave leverages that expertise through a set of strategic and operational services. Our broad product portfolio and industry experience combine to make operators and device manufacturers successful by improving the end user experience."
Openwave SDK is a free download and is a great tool for developing WML-based sites. The SDK comes with various emulators, each with their own set of features, allowing you to test your sites on various phones.