In: Categories » Internet » Web design and development » Wireless Markup languages ~ Overview ~ WAP WML WMLScript
| 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.
|
legal disclaimer
1) Our website 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 infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial 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. Please read the Terms of service
Useful tools and features
related articles
In today’s marketplace, across all industry segments, businesses are realizing that transformation to e-business is required to remain competitive. Analysts predict that companies not making the necessary changes will be overrun by their competition. As enterprises around the world undergo transformations, they are increasingly leveraging Internet technologies to help: Broaden their markets by extending their reach globally. Enter new business areas through collaborations or expan...
2. Building Shopping Cart Applications
The heart of any Web store is the software that it runs on. However, up until relatively recently, software solutions for e-commerce were largely do-it-yourself affairs, consisting of a number of disparate tools lashed together to fulfill the major tasks of an online store. This situation is changing rapidly. Every day sees the launch of a new software product, each of which claims to be a complete shopping cart. However, close investigation reveals a huge difference in the features that these products offer and the price...
3. The Essential Ingredients Of A Magnetic Website
Yes, believe it or not, there is actually a recipe for creating a website that is magnetic. A website that attracts targeted people far and wide like a super-powerful yet pinpoint-accurate magnet! If you apply each of these ingredients, but badly, you will have failed. If you address a quarter of them with gusto, accuracy and efficiency you will be well on the way to having a magnetic website whose profile just grows and grows. Your Shopping List For Baking A Magnetic Website • Great ...
4. Advantages and Disadvantages of HTTP Authentication
Authentication can be passed in the HTTP headers of incoming requests. This is the same type of authentication that is used when your browser creates a small login window when attempting to access a site. The authentication information is Base 64-encoded, so it does look like it is encrypted when transmitted over the wire, but in reality it is not. This encoding only ensures that all characters are valid to be passed in the header and is not intended to provide any level of security. Advantages: Easily hand...
5. Advantages and Disadvantages of Message Based Authentication
Client credentials can also be passed along with the regular message payload. This is marginally easier to implement on the client side because adding credentials should be no more difficult than adding another parameter to the request. Remember that even if a secure (SSL) endpoint is used, the URL used for the request is still sent in the clear, so if the credentials are passed on the URL (as is the case with a REST request), they will be visible to any and all intermediaries. Advantages: Easily handled &m...
6. 7 Things You Should Not Use in Web Design to Get a Quality Web Site
If you have any of these on your website or you have built websites for other people that include some of these ‘No-No’s’ then don’t feel too bad. We all make mistakes and it’s only my opinion right? 1. Flash In The Pan Pan being a slang term for toilet – as that’s where it belongs. Okay, maybe not all use of Flash but certainly Flash introduction pages. What a nightmare they are – ever visited a site where you positively revelled in the fact you got to...
7. How To Quickly And Easily Protect Your Adsense Account From Accidental Clicks
Not a day goes by without somebody complaining that they’ve been shutdown by Adsense because of “click fraud”. Scary isn’t it? Your kids or family members accidentally “stumble” on your website as they’re browsing the net (using the home computer)… and proceed to click on YOUR ads. You accidentally click on your ads yourself while you’re “checking” your site in your browser. Now, I’m sure that some people have accidentally ...










