What is WML?
Short for Wireless Markup Language, an XML language used to specify content and user interface for WAP (Wireless Application Protocol) devices; the WAP forum provides a DTD (Short for document type definition. A DTD states what tags and attributes are used to describe content in an SGML document, where each tag is allowed, and which tags can appear within other tags. For example, in a DTD one could say that LIST tags can for WML.
WML is supported by almost every mobile phone browser around the world.
WML pages are requested and served in the same way as HDML (Handheld Device Markup Language is used to format content for Web-enabled mobile phones. HDML is Openwave's (formerly known as phone.com) proprietary language, which can only be viewed on mobile phones that use Openwave browsers.
For Web servers to serve WML pages, they must contain the text/vnd.wap.wml mime type MIME (Short for Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII messages so that they can be sent over the Internet. Many e-mail clients now support MIME, which enables them to send and receive graphics, audio, and video files via the Internet mail system. In addition, MIME supports messages in character sets other than ASCII).
WML stands for Wireless Markup Language, and is what HTML is to a web browser. It is based on XML, or rather it is an XML application. If you're going from HTML to WML, with no prior knowledge of XML, chances are you'll find WML *very* strict. Just like HTML and XML, WML is read and interpreted by a browser built into the WAP device. For WAP devices, the browser is commonly called a micro browser, indicating that its capabilities are somewhat limited. These capabilities are of course also limited to the capabilites of the WAP device in which it lives.
Check your content on different browsers.
Most of the current WAP browsers suffer from bugs and incompatibilities with the published specifications. This problem is particularly severe when things should work according to the specifications but fail mysteriously on a particular browser. (This situation will get better with time; there is now an official test suite available and a certification program. But until both are widely adopted, incompatibility remains a serious problem.) This WAP browser incompatibility means that, for the time being, you should test your WAP applications on as many different devices as possible. Don't assume that some technique you've used will work everywhere just because it works on one browser. Try it out on different devices, preferably on one from a different manufacturer.
Check it on different screens.(#)
Don't write your applications for one device and assume that everyone else has the same screen size. There are few things more irritating than having a nice new PDA with a big screen and having four words of text on each page. On the other hand, be aware that putting long essays onto WAP sites will cut out the huge portion of your audience accessing your site via a cell phone. If you have content that will benefit from a big screen, consider making two versions of your site: one with lots of small files for cell-phone users and one with a few big files for PDA users. Things like news stories and sports reports really benefit from this sort of treatment.
Also, don't rely on a screen's width to be a particular dimension. Some sites lay out tabulated information by relying on a particular cell phone to put line breaks in the right places. This type of layout is completely unreadable on most other cell phones, let alone PDA browsers.
Provide alternatives to timers.(#)
Many WAP sites use WML's timer facilities to display logos and splash screens before the main content loads. Very few sites provide any alternate means of entering the main page if the timer does not work as expected. If no alternative is provided, the user will be stranded on a page with no way to go forward or back.
The most common reason for a timer to fail is a name attribute on the timer referencing a variable that isn't initialized properly somewhere else. This works fine the first time, since the default value is used, but later visits to the same page will use the value "0" for the timer, which disables it. To be on the safe side, always provide a
Use images sparingly.(#)
WAP is not the Web. Screen sizes are small, and download times are long. Use an image only where a few words of text isn't enough. You can probably fit only one image on-screen at a time on most cell phones, so the complicated image-based layouts on so many Web pages are simply impossible on a WAP site. And don't use images as bullet points or other decorations. Not only does this slow down page display on most devices, but you cannot rely on the image appearing where you want it to on some browsers.
A direct call link in WML(#)
WML pages are designed to be viewed on a cellular telephone, and cellular telephones are designed to be used for calls. Combine these two uses by offering a link to your telephone number on your WAP site. Simply place a link of this type using the card you want on your WAP packet:
Then replace what follows 0 by your telephone number (remember to delete the first 0 here).
When your visitors click on this link, their telephone will automatically dial your number to contact you. Practical isn't it?
Convert images into WAP ready ones.(#)
WAP Pictus is an image conversion package for turning full color BMP,GIF or JPEG images in WAP ready WBMP images. The program is fairly simple and a single click will invoke the transformation on an imported image. Other features include image resize and dithering settings for adjusting the conversion quality.
What is a valid WML deck
A deck is referred to as a single collection of cards in WML, where each card contains structured content and navigation. A WML deck conforms to the WAP Forum WML specification; it is surrounded with
Every valid WML deck must contain an XML declaration as a valid XML document, as well as a document-type declaration, both of which are specified at the beginning of the WML deck .
Here is an example of a validation declaration in the header of a WML file:
Another example, using a different site:
WML is highly structured and very particular about syntax. Several current HTML browsers allow for "messy" code such as missing tags and other formatting snafus. Such mistakes are not allowed in WML; the mobile browser will complain and generally won't display the page.
WML is case sensitive.(#)
The tags and are treated as different tags, although they accomplish the same purpose (bold text). Therefore, you must be careful to match the case of your opening tags with your closing tags (for example, This isbold will not work as expected).
Many tags have required attributes. Developers accustomed to HTML may be used to including only attributes they need-in some WML tags, you must include a few attributes, even if they are blank or default.
WML supports the
The currency rates were obtained from the Federal
Reserve Bank of New York on $(date).
We see here the tag, which calls the WMLScript function getInfodate(). This function loads the date variable with the date in the past on which the currency rates were obtained. It is invoked inside an onevent tag, with the event being entering the card, onenterforward.
The card itself includes two items. First is a free-text message, "The currency rates...." The second important item is the Back soft key. It is important to provide users with the key to go back from this Help card.
Tips for the best development tools
You can develop your WAP pages with Notepad, but as with all kind of development it's easier and faster if you have the right tool at hand.
Waptor 2.3 (736Kb) for Windows from WAPDrive.A small and easy to use WML editor and viewer for Windows. Some knowledge of WML is necessary.
Mobile Application Development Kit (MADK) (20.6MB) for Windows from Motorola Motorolas free SDK for WAP developers. Includes a phone emulator and a WML development tool.
Wireless Companion (3.2MB) for Windows from yourwap.com. An combined HTML and WML browser. You must have Internet Explorer 4 or Netscape 4 or newer browser installed because the HTML browser uses their engine. You can choose one of the following phone skins: Ericsson 320, 380 or a Nokia 7110.
WAPman (181kb) for Win32 and Palm is a WML viewer for windows. This connects to a gateway, and if the gateway is unavailable then the program don't work.
WinWAP (1.2Mb) for Win32 is the fastest and easiest way to view WML pages without a WAP device. (except for the Wapalizer of course). Even if it's version 2.2,it's still a little buggy. All WML decks will display correctly, but sometimes the links don't work.
Nokia WAP Toolkit (10.8MB).You must register to download the toolkit, but there is no other way to do this if you are serious about developing and testing WAP sites.
Ericssons WapIDE SDK (5.49MB).The Ericssons SDK are a collection of software for developing WML decks, device designer for creating visual layout of the devices, WML browser, Application Designer and Server Toolset containing perl libraries.
UP.SDK (5.8MB) Phone.com's SDK. By testing your WML decks with different development tools, your are able to filter out most possible errors. The downloadable from Nokia is sometime not enough. If you for example creates a WML deck to large for the gateway, no Nokia product will tell you what's wrong. But this SDK will. Photoshop/Paintshop WBMP plug-in. This plug-in is a must have for anyone working with images for WAP. This plug-in let you open and save images in WBMP format.
Online WBMP converter. This service gives you the opportunity to upload and convert GIF's and JPG's to WBMP via the browser.
WBMP converter for Win32 Drag and drop converter for Windows. Let you easily converts GIF to WBMP (WAP images). Go to the Nokia web site at http://www.nokia.com/ and download the Nokia WAP toolkit. Then get a WAP browser to use on your computer from http://www.tucows.com
WBMP Wapaint.com allows you to make your own real time graphics for your WAP compatible cellular , with the WBMP format.
Download wbmp (wab, wml, wireless images format) plug-in for Adobe Photoshop This plug-in allows Photoshop (and compatible Photoshop hosts) to read and write type 0 WBMP. This format is currently used for wireless devices.
Emulate a WAP phone on your Desktop.(#)
Emulate a WAP phone on your Desktop. This WAP browser goes the whole hog and not only gives you access to WAP Internet content but it also emulates a WAP phone, complete with mobile phone style fascia, working buttons and the navigation dial for scrolling up and down the page. On first impression it has a novelty appeal, but on the practical side it's the most realistic way to test your WAP pages without actually using a real WAP phone.
To set up the mime type in IIS: console management, actions, properties, http headers, new type, also is in HELP, but not very clear.
Content-type: text/vnd.wap.wmlTo view files, use the following syntax:
Or, assuming a mount of the CTILAB machine on drive E:
We had to associate .wml with the mime header in IIS, and had to do it in several places, not knowing which worked.
To check syntax
Save the .wml file as .xml and open in IE. Or, associate .wml files with internet explorer.
This will check the XML well-formedness, and provide some useful feedback if not correct.
In ASP the default mime type for response. write is text/html, so we have to specify that explicitly to be text/vnd.wap.wml
F9 is reload. Sometimes we have to restart the phone simulator to fix things.
URL has to be fully qualified in "dest" (destination). URL in form action statement in HTML, according to the spec, must be fully qualified. No one requires this however. BUT, it IS required for DEST in WML and HDML.
Tips for Server hosting
Free space for your WML pages: Wapdrive, Wappy, TagTag or Hoiley. These hosts are dedicated to host WML pages, but many host providers are now offering hosting of WML pages as well as HTML pages.