Get started with WML - Web Development - Techguide

Get started with WML

 

Summary

WML is a close cousin of HTML; it allows wireless content to be easily developed using a relatively familiar syntax. Here's a look at the basics and some sample code to introduce you to the language.

Events

Echelon 2012
June 11 and 12, 2012

University Cultural Centre, National University of Singapore

Startup Asia Jakarta 2012
June 7 and 8, 2012

12th Floor, Annex Building, Wisma Nusantara Complex, Jl. M.H. Thamrin No. 59 Jakarta 10350, Indonesia

MMA Forum Singapore
April 23-25, 2012

Grand Hyatt Singapore

WML is to WAP what HTML is to HTTP. However, because of the lack of bandwidth and the minimum capability of WML browsers embedded in mobile phones, WML has been developed into a much slimmer language, shedding all the features of HTML that would be useless for wireless devices. Let’s take a closer look at WML.

Shuffle the deck
The WML parallel of an HTML page is termed a deck. So when you try to access a WAP site using any WAP-enabled device, what is actually getting to your device is a deck. A deck can be broken down into cards. In fact, what is visible at a glance is one card and not an entire deck. These cards can link to other cards, and navigating to other cards is possible programmatically as well as in response to user input.

A deck is the smallest unit that can be sent by the server to a WAP client, and it can contain one or more cards. Listing A contains a sample WML file.

This example is a basic WML deck containing three cards. The card with the id "first" is, not surprisingly, the one that is displayed first. Although the other cards also come to the client as part of the deck, they are not initially visible. On clicking the Click Here link, the second card is visible. It has an image and an embedded list box.

What is interesting is the use of $(OS) in the third card. OS here refers to the list box name on the second card. Hence, based on selection made on the second card, the message on the third card can change.

The WAP toolbox
If you are wondering how in the world you are going to check out how this WML content would be displayed on a mobile phone, fret not. More than a handful of WAP simulators and development tools exist. The best of the lot seems to be the WAP Toolkit provided by Nokia. Since Nokia is ubiquitous in the mobile market, you surely want your WML pages to be displayed properly on its handset.

If you are using Macromedia Dreamweaver, a pretty nifty way to get your WML pages done in no time would be to get hold of the Nokia WML Studio plug-in for Dreamweaver. It makes WML development with Dreamweaver a cinch.

Most of the leading handset providers, such as Ericsson and Motorola, have toolkits that can simulate how your page will look on their respective handsets. If you are looking for a basic editor that will quickly get some pages up, Coffee Cup Wireless Web Builder is a solid product that includes an easy-to-use WML page creator.

Jazz up your WML
Pure text pages are boring. To spice up your WML pages, you need well-placed but sparingly used WBMP images. WBMP is the WAP image standard format. Creating WBMP images is definitely not a tough task, but you can get tons of images that suit your purpose from the Net. If you are still keen on creating your own images, try your hand at the WBMP image maker included with the Coffee Cup Wireless Web Builder.

Gathering data
Dynamic pages that send data to the server are pretty much essential for you to do anything worthwhile on the Net these days, so WML needs the capability to submit user data.

There is no direct HTML <form> tag parallel in WML. To submit data, you use postfields, and you use the $ sign to fetch user input and pass it on to the specified href. Listing B provides an example. Upon clicking Submit to Servlet, the data that's been entered in the Login and Password fields would be passed on to the specified servlet. So if I enter Harshad in the Login field and Oak as my password, on submission, my query string should look something like
http://localhost:8080/AbcServlet?loginName=Harshad&loginPass=Oak&msg=HELLO

WAP yourself into shape
Get going with WML and make your presence felt in the wireless world. A significant advantage of having WAP expertise is that although it is pretty easy to latch on to, it still is rather rare in the technical marketplace.

Are you working with wireless technologies?
Share your wireless development experience with the Builder.com community by posting in the discussion below or send us an e-mail.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment

ZDNet Asia Live

Kodak loses patent ruling against Apple, RIM. http://t.co/N1j7aZ6o

#radio Radio Serbia by EnjoyIT 1.0 http://t.co/nGQFvX2E

Rise in <b>Chinese</b>-funded acquisitions could trigger more hurdles http://t.co/0pXBS1HR

Rise in Chinese-funded acquisitions could trigger more hurdles: By Ellyne Phneah , ZDNet Asia on May 22, 2012 (6... http://t.co/W3SOdw2c

RT @zdnetasia: CFOs increasingly involved in IT investment decisions. http://t.co/8QrfwOSb

CFOs increasingly involved in IT investment decisions http://t.co/XD1LerFq via @zdnetasia #PrivateCloud #SC2012 #CAPEX

Rise in Chinese-funded acquisitions could trigger more hurdles. http://t.co/VC3G3m3o

RT @zdnetasia: Rise in Chinese-funded acquisitions could trigger more hurdles. http://t.co/VC3G3m3o

So much as we know , MTK6575 extremely integrated frequency1GHz ARM Cortex-A9 processor, the superiority of 3G / HSPA Modem, and help the...

1 hour ago by y15822137359 on 5 SaaS adoption speed bumps to avoid

Rise in Chinese-funded acquisitions could trigger more hurdles - ZDNet Asia: Rise in Chinese-funded acquisitions... http://t.co/bZaAQnRL

Rise in Chinese-funded acquisitions could trigger more hurdles http://t.co/mIsuZjnU http://t.co/erFX4aVv #arcavir

http://t.co/VNaZtseV Rise in Chinese-funded acquisitions could trigger more hurdles: "Cash r... http://t.co/N0gZZEdR http://t.co/wiqY9ktt

Rise in Chinese-funded acquisitions could trigger more regulatory clearance issues overseas http://t.co/cvLSpTwo #in

Alibaba seeks $2.3B from shareholders for Yahoo deal. http://t.co/qLRAhRQk

CFOs increasingly involved in IT investment decisions. http://t.co/8QrfwOSb

Quickflix WatchNow 2.0 http://t.co/XWti5VWT

I reckon your view: "CRM is strategy, not software", if a company replicating the approach uses in ERP implementation into CRM, what they...

1 day ago by wykoong on Gartner: Mobile CRM gives better ROI than social

This video will teach you about the Excel fill handle but also provide you with a workook to download... http://www.youtube.com/watch?v=...

1 day ago by TradeBrother on A quick fill handle trick for Microsoft Excel

waiting...

3 days ago by eapete on What should count in a company's market value?

Boy, you've opened a can of worms now.

Wait for the rants & raves.

3 days ago by eapete on What should count in a company's market value?

I was puzzling before this whether to replicate the success formula we executed for a financial institute, and come out with a standard s...

4 days ago by wykoong on Drop the egos, copy ideas, then innovate