WAP: Navigating Decks and Cards with WML
The "Mobile Web" is here, but it's not what you think. Forget images and complex layouts. We're building for 1.5-inch monochrome screens. In WML, we don't have "pages"; we have Decks, and each deck contains one or more Cards.
A Simple WML Deck
To save on expensive GPRS/dial-up latency, we bundle multiple views into a single WML file (the deck).
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="main" title="Aunimeda WAP">
<p>
Welcome to the future!
<select name="choice">
<option onpick="#news">Latest News</option>
<option onpick="#stock">Stock Quotes</option>
</select>
</p>
</card>
<card id="news" title="News">
<p>
WAP is taking over the world!
<anchor>Back<prev/></anchor>
</p>
</card>
</wml>
Variables and State
WML allows you to maintain state using variables without a server round-trip.
<card id="set_name">
<p>
Enter Name: <input name="userName" type="text"/>
<do type="accept" label="Greet">
<go href="#greet"/>
</do>
</p>
</card>
<card id="greet">
<p>Hello, $(userName)!</p>
</card>
Testing this on a real Nokia 7110 is the only way to be sure it works. The emulator on your PC is too fast and the screen is too big. Real WAP development is about counting every byte and every click of the scroll wheel.
Aunimeda develops websites and web applications for businesses - corporate sites, e-commerce, portals, and custom platforms.
Contact us to discuss your web project. See also: Web Development, E-commerce Development