How to create a WAP site for mobile phones with WML

 

 

[vc_welcome2 icon=”mobile” icon_color=”#000000″ icon_bgcolor=”#f4f4f4″ icon_size=”44″]

WAP mobile sites. Why? Because I was reading about RIM today and thinking back to all the fun times I had broadcasting live video to Blackberry. That’s why. Enjoy.

[/vc_welcome2]

 

 

WAP & WML : Decks and Cards

WAP sites are generally one file that contains many sub-pages within the master WML page. Each page is defined with a special tag called “<card>”. This is why WML pages are known as “decks”, because they contain multiple cards. Each card can contain text, links, input fields, tasks, images, and more. You can provide navigation from card to card with links that work just like HTML anchors (with a # sign to indicate the id of the card.)

Example WAP code

Here is an example WAP site with two cards, each one containing a link to a different type of 3gp mobile video.

1
2
3
4
5
6
7
8
9
10
11
12
13
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml"&gt;
&lt;wml&gt;
&lt;!-- Your site code goes in between the wml tags --&gt;
&lt;card id="card_one" title="Card 1"&gt;
&lt;p&gt; &lt;a href="rtsp://streaming-server-address/sample-movie.3gp"&gt;3gpp movie &lt;/a&gt; &lt;/p&gt;
&lt;a href="#card_two"&gt;Next Page&lt;/a&gt;
&lt;/card&gt;
&lt;card id="card_two" title="Card 2"&gt;
&lt;p&gt; &lt;a href="rtsp://streaming-server-address/sample-movie.sdp"&gt;Live 3gpp stream&lt;/a&gt;&lt;/p&gt;
&lt;/card&gt;
&lt;/wml&gt;

Images

Though generally not encouraged for mobile sites, you can use images. To place images on your WAP site, you must use the .wbmp format. There are many free converters out there, such as WAP Tiger
For example:

<img  src="http://yoursite.com/logo.wbmp" align="middle" height="100" width="100"/>

Tables (not supported by all phones)

If you wish to use tables, there are a few differences between WML and HTML that you must note: First, the tbody tag does not exist in WML. Second, the attributes of the table tag are “title” (the title of the table), “align” (C=center, L=left and R=right) and “columns” (the number of the columns)

<table align="C" title="label" columns="3">
<tr>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
</tr>
</table>

Finishing Up

Once you have uploaded your .wml file to your web server, you can direct mobile users to a URL such as “http://www.yoursite.com/your-wap-site.wml”

Here’s some WAP resources, why not? : http://www.waponthenet.com/default.asp

 

 

0