January 16, 2007 by Soo
I noticed the other day that a lot of people really mean WAP1.0 when they talk about WAP. But WAP 1.0 is old hat!! Mobile phones support WAP2.0 these days and if you are designing a WAP site, it’s better to do it for WAP2.0. I’ll tell you why.
Using WAP 2.0, sites can be coded in xHTML. Though WML (which was used for WAP 1.0) is really simple, it was difficult to do any kind of text formatting or graphics with it. However, if you already have an existing product in WML, you may want to re-code it in xHTML. xHTML also has a version for mobile devices called xHTML MP.
WAP 2.0 is also backward compatible to WML 1.x, which means WAP 2.0 mobile devices can display WML 1.x documents. If there is a WML feature that is necessary for your product/service but is not available in xHTML MP, you can consider developing your WAP application with WML 1.x. (or using a combination of WML 1.x and XHTML MP?).
Apart from the mark up language changing from wml to xHTML, the transmission protocol also changes from WAP to wTCP/IP (Wireless profiled TCP).
This essentially means that we can have greater convergence between mobile and fixed domains and a greater level of security.
The main advantage of using xHTML over wml is that we can separate functionality and content from the display – so your main code is separate from your style sheets. Just like it is on the internet! The good thing is that you have to only change the style sheets when your application is not being properly displayed on any of the different phone browsers.
Each phone browser has a default style sheet. Developers can over-ride most of the styles by defining their own. The level of priority is like this –
- Browser’s default style sheets are applied first
- External style sheets are applied
- Any <style> element in the document over-rides the external style sheet
- Inline styles over-ride any earlier style defined for that tag only
- Any style with the tag <!important> over-rides any previous style defined for that tag.
The one phone where I haven’t seen this working is the Motorola RAZR v3i. I’m not sure whether that is a Motorola feature or only specific to that phone.
SOME REALLY USEFUL FEATURES OF WAP2.0
XHTML MP supports WAP CSS, so there is more control over the presentation – like borders, backgrounds, margins, padding, etc. font sizes, font families and font colors can also be specified. Such features are not available in WML 1.x.
Using XHTML MP and WAP CSS, it also possible to separate content and presentation in different files. As you all know, mobile devices have very different characteristics such as screen sizes. The separation of the content and the presentation means you can write the content once, and change the style and layout to suit different wireless devices with various WAP CSS files. The separation of the presentation and the content also mean that files will become lighter and can be downloaded faster.
If you apply a single cascading style sheet to the whole mobile Internet site, a mobile device will download the style sheet only once the first time the mobile Internet site is visited. The cascading style sheet will then be stored in the cache and it can be accessed later without connecting to the server.
Font style – You can use tags to change the font style of the text in XHTML MP. However, some WAP browsers only support a subset of these tags, even though these tags are defined by the XHTML MP specification. This is because the WAP browser can only make use of the fonts available on the mobile device. For example, if the italic font is not available, the italic style is not supported. Unsupported XHTML MP tags will be ignored by WAP browsers and will not cause any error.
New input elements in XHTML
- Text field
- Password field
- Radio button
- Hidden field
The -wap-marquee Value WAP CSS can be used to make text, an image, or other content that is too wide to fit on one line on the screen to scroll across the screen. Now isn’t that great?But use it judiciously(!!)
Submit, Reset, and Default Buttons (labeled push buttons) since data cannot be posted with a link as on WML.
FEATURES OF WML THAT WAP2.0 DOESN’T HAVE
- decks and cards but you can usemultipart messages or target anchors instead. XHTML substitute for the <card> is the <body> tag.
- timers but HTTP refresh can be used in XHTML MP to instruct the WAP browser to refresh the current page periodically.
- variables, so one alternative is to put all processing at the server-side.
- client-side scripting which is not currently available for XHTML MP. The alternative is to do all processing at the server-side. In future mobile devices will support a client-side scripting language called ECMAScript Mobile Profile (ESMP), which is designed to be used with XHTML MP. It supports all WMLScript functionalities.
- programmable soft keys but the accesskey functionality can be used instead. The accesskey attribute is used to specify a keypad shortcut.
- <u> tag (underline) but the text-formatting property of WAP CSS is used.
- format attribute for input fields but the -wap-input-format property of WAP CSS can be used.
For all you web developers out there, all this may be nothing new. But if you’ve been using WAP1.0, it’s a whole big deal!