learn more...The most common standard of data transfer and presentation for a handheld device involves the combination of Wireless Application Protocol (WAP) with Wireless Markup Language (WML). Although WAP can be used with other forms of presentation, its coders primarily designed it to be used with WML. WAPBecause of the small size of PCS devices, and because they operate with much less bandwidth or speed, than the rest of the Internet, a special protocol was necessary to redefine how they handle data transmission. This protocol needed to take into consideration that the average user views information on a screen with as little as five lines. When compared to a computer screen, this is a colossal difference. In addition to size, the typical PCS device does not support the same type of navigation that a desktop browser uses. Typically, you perform all PCS navigation with a list of options, or by pushing a button on the PCS device. To illustrate, compare CNN's top news page viewed on a cell phone to the same page viewed with Internet Explorer on a desktop machine.
In other words, the process of fetching Internet content to a Web-enabled PCS device is handled in two parts. The first part requires the gateway server to connect to the Web server and retrieve the actual content of the Web page. The second part converts this content to a format compatible with the PCS device, and then transfers this content to the device. This is where WAP becomes an important part of the process.
Once the data maneuvers through this stack, The PCS device processes it and presents it on the screen with a minibrowser. This can be as basic as maneuvering through a menu, or it can be as complex as playing an interactive game. WMLNow that you have a basic understanding of WAP's purpose, let's examine the actual data and how it is presented. As mentioned before, WML is a markup language based on XML. It is not a programming language such as COBOL, Java, or even VBScript. It is only a formatting language that defines text and object placement and appearance. For example, if you wanted to define a word as bold, you would use the following: <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//ED" http://www.wapforum.org/DTD/wml12.dtd> <wml> <card> <p> -Top Stories-<br/> <a accesskey = "1" href=http://mobile.cnn.com/sharon.wml title="sharon">Sharon announces…</a><br/> <a accesskey = "2" href=http://mobile.cnn.com/bush.wml title="bush">Bush presses Congress…</a><br/> <a accesksey = "3" href=http://mobile.cnn.com/colombia.wml title="colombia">Colombia targets…</a><br/> <a accesskey = "4" href=http://mobile.cnn.com/ex-priest.wml title="ex-priest">Ex-priest gives…</a><br/> </p> </card> </wml> After looking at the sample code, do you see any similarity between it and XHTML? You should. In fact, WML is a brother to XHTML, and as such, has inherited all its rules. Note that each tag has a matching closing tag, or in the case of <br/>, is closed by the trailing backslash (/). Also, note the lowercase lettering and use of quotes. These are all requirements of XHTML that have been integrated into WML. WMLScriptA developer can incorporate any number of programming or scripting languages into a Web page. These languages can be classified as either server-side scripting or client-side scripting. Server-side scripting typically handles complex issues or processes that must remain secure because of database connectivity. Client-side scripting, on the other hand, is typically used for simple programming needs, which often includes form validation and presentation enhancements, like trailing mouse images. However, client-side applications can also consist of complex programming. Add.wml _______________________________________________________________________ <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.3//EN" "http://www.phone.com/dtd/wml13.dtd"> <!-- WML file created by Openwave SDK --> <wml> <card id="first" > <onevent type="onenterforward"> <refresh> <setvar name="firstVal" value=""/> <setvar name="secondVal" value=""/> </refresh> </onevent> <p> <do type="accept" label="Plus"> <go href="#second"/> </do> Add two numbers... First #: <input type="text" name="firstVal" format="*N"/> </p> </card> <card id="second"> <onevent type="onenterforward"> <refresh> <setvar name="ans" value=""/> </refresh> </onevent> <p> <do type="accept" label="Add"> <go href="addit.wmls#addNum()"/> </do> Second number <input type="text" name="secondVal" format="*N"/> $firstVal + ______ = </p> </card> <card id="answer" title="answer"> <p> $firstVal + $secondVal = $ans </p> </card> </wml> _______________________________________________________________________ addIt.wmls _______________________________________________________________________ extern function addNum(){
//grab incoming values var fv = WMLBrowser.getVar("firstVal");
var sv = WMLBrowser.getVar("secondVal");
var val = WMLBrowser.getVar("ans");
//convert values to integers var fvNum= Lang.parseInt(fv); var svNum = Lang.parseInt(sv); //add values var valNum = fvNum + svNum; //set answer and return to answer card in deck WMLBrowser.setVar("ans", valNum);
WMLBrowser.go("#answer");
} Note WML differs from any other formatting language. As you can see in the code sample, the WML file is actually a series of cards. Each card represents a possible screen, but is linked to the other cards in the deck, or group of cards. You can also see the proper implementation of XHTML and XML rules. Quotes, closed tags, and lowercase attributes are all used consistently within this file. |
||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. link to this article |