GO HOME IT Documents Mobile World IT Forum About us
 
Mobile Internet: WML / WAP Tutorial
Part 1 - Introduction
Part 2 - Beginning A WAP Site
Part 3 - Adding Text
Part 4 - Hyperlinks & Images
Part 4 - Hyperlinks & Images
 

Introduction

In part 3 I showed you how to create a basic WAP site with one page and some text. This week I will show you how you can make this better by adding extra parts, linking to them (and other sites) and how to add images to your site.

More Cards

As I explained in the second part of this tutorial, WAP sites have cards instead of pages. They are really the same as pages except they can all be written in one file. To add another card, all you need to do is put in another <card> tag with a different ID to the others. For example:

<card title="About Me" id="about">
information
</card>


would be added below the first card but before the </wml> tag.

Linking

There are three ways to link to another WAP site, file or card. Just like in HTML these can either be the full path to a file or a relative link.

To link to a WAP site you use the following:

<a href="http://muneerwap.peperonity.com/">MuneerWAP</a>

in your text. To link to another file on your site you would use:

<a href="links.wml">My Links</a>

and to link to another card in the same page you use:

<a href="#about">About Me</a>

Images

Unfortunately, because WAP phones only have limeted size of screens, images do not work very well on WML pages. Some monochrome phones use their own image format: WBMP. When you are creating an image to use on your site you will need to make it small (mobile phone screens are about 128x128, 128x96 or little bigger pixels).

The easiest way to get an image into the WBMP format is to create it as a GIF or JPG (it can be in color if you want) and then visit Teraflops.com to convert it into a monochrome (black and white) WBMP image which you can then include on your site. Or you can use JPEG, GIF and PNG format for new types of mobile which are on use todays.

Images are inserted using the <img> tag, just like in HTML:

<img src="logo.wbmp" alt="Logo" />

Again, you can see that a / has been added at the end as the <img> tag has no closing tag. It is very important that you also include the alt text as it will be displayed while the image is being downloaded.

 

Example Site

Below is the sample WML code for a small WAP site. It has two cards, an image, and a link to an external site:

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="index" title="My WAP Site" newcontext="true">
<p align="center">
Welcome to my new WAP site. You can view this on your mobile phone anywhere in the world!<br/>
<img src="logo.wbmp" alt="Logo" />
</p>
<p>
Here are some links:<br/>
<a href="#about">About Me</a><br/>
<a href="http://muneerwap.peperonity.com/">MuneerWAP</a>
</p>
</card>
<card id="about" title="About Me">
<p>Here is some information about me. You can't write too much in here, though as there is not much space<br/>
You can scroll down the screen, of course.
</p>
<p align="center">
<a href="#index">Back</a>
</p>
</card>
</wml>

 

NEXT- Coming Soon

  • Sending data from phone
  • Creating tables
  • Automatic Redirection
  • Starting phone calls
  • SMS over WAP
 

If You have new ideas and techniques please post to us webrider.net@gmail.com we will produce them in this site.

   

Design & Content © msmmuneer & webrider.net 2006-2007
For problems or assistance with this site, Emai to webrider.net@gmail.com