WML Bigromu

This will help you build Learn WML,Learn WAP applications...Learn WML,Learn Wireless,Understand Markup Language Tutorial, Wireless Application Protocol Tutorial, Building WAP sites tutorial, Building Wireless Application Protocol Website tutorial, Web Site tutorial, Wap Site tutorial, Wap tutorial, WAP tutorial, Site Mobile tutorial, Mobile Site Tutorial, PDA SITE,

Saturday, December 09, 2006

A simple HAWHAW code

Create a new file in the same directory where hawhaw.inc is located. Use an editor of your choice to write the following PHP script:

require("hawhaw.inc");
$myPage = new HAW_deck("FAQ Demo");
$myText = new HAW_text("Hello WAP!");
$myPage->add_text($myText);
$myPage->create_page();
?>

Store this file as test.php. (Alternatively you can save your file as test.wml if you have administered your webserver to activate PHP for .wml extensions.)

What is the meaning of these few instructions? Before you can use any HAWHAW function calls, you have to include the hawhaw.inc file. Afterwards you have to define one so-called HAW_deck object. The whole HAWHAW API follows a strict object-oriented approach. There are some objects like HAW_deck or HAW_text. And there are object functions, to perform actions on those objects. So what we do in line 3 of our tiny example is: We define $myPage as an object of the class HAW_deck. When you take a look at the HAWHAW reference, you will see that the constructor of HAW_deck optionally awaits some title for your 'deck'. Btw, a deck is an expression that is often used in the WAP terminology. In HAWHAW's context you don't have to distinguish between deck and page. It is the same.

When you examine the HAW_deck constructor in the reference in detail, you will notice, that there is another optional input parameter alignment. If you would have called

$myPage = new HAW_deck("FAQ Demo", HAW_ALIGN_CENTER);

the whole deck would have been displayed centered. Every time when there is a predefined value mentioned in the argument list of a function, this value is provided by default as long as you don't supply this parameter explicitely.

So, what we have now is an empty HAW_deck object. Let's bring some content into it: In line 4 a HAW_text object is defined. The reference entry for HAW_text tells you that you have to provide the text (you guessed that, right?) and (optionally) a text format. But to define this object does not automatically make it a part of your HAW_deck object! Therefore you have to call the HAW_deck object's object function add_text(), as done in line 5. Perhaps you ask now why this association is not done automatically, but you will understand it, when you want to re-use HAW_text or HAW_image objects in many positions of your HAW_deck object.

Okay, now we're almost through. We have defined our HAW_deck object and we have filled it with one HAW_text object. Now we only have to make the whole thing visible. Therefore we have to call the HAW_deck object function create_page(). So what we have learned is: For EACH page created by HAWHAW, we have to create ONE HAW_deck object, fill it we some content (like text in this example or images, links etc. as we will see in the succeeding paragraphs), and finally throw it out by calling create_page().

Now point your webbrowser to test.php: What you see is the most simple HAWHAW application ever possible.

VoiceXML

XHTML Mobile Profile (WAP 2.0) will be the standard for modern phones. If HAWHAW detects a XHTML-capable phone, dedicated XHTML output is created. From HAWHAW version 5.4 on there comes color to phone! HAWHAW application programmers are able to design colored applications which are viewed best on a XHTML device or PDA with color display, while these applications run well on each old monochrome WAP 1.1 device too.

XHTML ???

XHTML Mobile Profile (WAP 2.0) will be the standard for modern phones. If HAWHAW detects a XHTML-capable phone, dedicated XHTML output is created. From HAWHAW version 5.4 on there comes color to phone! HAWHAW application programmers are able to design colored applications which are viewed best on a XHTML device or PDA with color display, while these applications run well on each old monochrome WAP 1.1 device too.

MML ????

MML (Multimedia Markup Language) is a markup language used by japanese mobile devices from J-Phone Communications Co Ltd. If HAWHAW detects an MML device, cHTML-like MML output will be generated.

iMODE ???

i-ModeTM is the killer application in Japan and is on the jump to conquer other countries too. Whenever HAWHAW detects an i-Mode browser, cHTML output will be generated.

Visit DoCoMo

HDML????

HDML is a WML predecessor and still widely used in North America and Japan. Whenever the HTTP request header indicates that the client browser supports HDML 3.x only, appropriate HDML output will be generated by HAWHAW.

Why to use HAWHAW?

HAWHAW satands for HTML And WML Hybrid Adapted Webserver.

The current situation out there is that many WAP applications are highly incompatible and not able to interwork with different mobile devices. This is mainly caused by strong differing browser implementations and network configurations. Starting to program WML means to painfully learn about all those pitfalls one by one and day by day.

With HAWHAW, the programmer can rely on the accumulated experience of many running mobile applications. The compatibility of a direct WML-coded application is highly dependent from the programmer's personal knowledge. The mark-up output of a HAWHAW-based application contains the knowledge of many running HAWHAW applications out there. This does not mean, that the HAWHAW-created output is totally perfect under all situations. But it will automatically become better and better because each feedback from a single application can result in an improvement of the underlying hawhaw.inc library.

Existing HAWHAW sites will therefore benefit from future HAWHAW evolution steps. Without any additional development effort you can upgrade your running applications. Users of the HAWHAW PHP class library simply download a higher version of the HAWHAW class lib. HAWHAW XML users are upgraded automatically in the very moment, when the involved HAWHAW proxy upgrades to an higher version. This way your site or application is best prepared for future requirements.

HAWHAW was developed according to the Wireless Application Protocol Wireless Markup Language Specification Version 1.1 and according to the HDML Language Reference V3.0. It additionally supports the Openwave GUI extensions for WML 1.3. If HAWHAW's browser detection recognizes that the requesting device supports the proprietary Openwave WML extensions, special WML output will be submitted. There is no extra effort required to support GUI elements like select boxes, radio buttons or submit buttons. WAP devices which understand WML 1.1 only, will receive the standardized WML tags instead. So there's no need for the application programmer to deal with different code for various browsers.

Browser compatible WML

Creating your wapsite compatible with all kind of browsers is a big headaque. Various tyoes of browsers available on mibole devices are WAP, WAP2.0, iMode, HDML, XHTML, MML VoiceXML and lots of other species are available on PC.

Now, I will discuss how you can create your wap site browser independent.

I will discuss here a opensource class "HAWHAW".

HAWHAW is a toolkit that helps webmasters to make their website mobile, i.e. accessible by a wide range of mobile devices and standard browsers. There are three components the HAWHAW toolkit consists of:

* hawhaw.inc - The PHP class library
* HAWHAW XML - The markup language
* HAWXY - The HAWHAW proxy

Each of these components will be explained in detail here in this document.

Each HAWHAW users can choose the component which fits best for his personal requirement:

PHP programmers can use the PHP class lib, to set-up taylormade mobile standalone applications on their PHP enabled webserver.

Webmasters can use the HTML-like HAWHAW XML markup language, to provide wireless accessible content without any programming skills or special webserver support.

Service providers can set-up their own HAWHAW proxy, which can be used by the before-mentioned webmasters for the required markup conversion.

The whole HAWHAW code, both for the HAWHAW PHP class library and the HAWHAW proxy server is open-source and available for free under GPL. Users of the HAWHAW XML markup language don't need any code at all, because they just have to edit HAWHAW XML files, which are accessed via other people's proxies.