Technology| GPS| WiMaX| VoIP| WiFi| HSDPA| WAP| EAI| Questions? | Software Development
 

Writing your First WAP Application.

Writing your First WAP Application. Tutorial Writing your First Application. N ow it's time to mould your Internet Data for the entire Unwired World! Our "Welcome to Unwired World" application will familiarize you with the WML code. As

Tutorial

Welcome to Unwired World! Output

  

Writing your First Application.

Now it's time to mould your Internet Data for the entire Unwired World!

Our "Welcome to Unwired World" application will familiarize you with the WML code. 

 
   
As mentioned earlier WAP applications are written in WML (Wireless Markup Language). Now first of all we will explain the WML. WML is a markup is strongly similar to HTML and is based on Extensible Markup Language(XML). Formal Document Type Definition (DTD) for WML is provided by WAP Forum and is available at:

        http://www.wapforum.org

Getting Started
To write a WML page you can use your favourite text editor like Notepad or Wordpad. After writing it save as '.wml' file. U.P. Browser (download and Install Phone.com - UP.SDK 4.x) can be used to test the page. Our site also provide the facility for you to test your code.

Understanding Deck and Card
The whole WML-page is called a Deck and it consists of one or more cards. Each card contains the information that is displayed on the cellular devices in one screen. So in one Deck you can define one more screens. Cellular device displays first card when it receives a Deck. And in first card using elements and attributes we can define our navigational structure between different cards.

Let's create our first application. So, here is the code of our application.

<?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="Card1" title="Learning WML ">

<p>

Welcome to Unwired World!

</p>

</card>

</wml>

To test the above code copy and paste below and then press test button.


  

In any WML application first three line is must and it contains the XML and document type declaration.

<?xml version="1.0"?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"

"http://www.wapforum.org/DTD/wml_1.1.xml">

     

After XML and document type declaration WML deck start with <wml> and ends with </wml> tags. Each deck may contain one or more cards. First card of WML page is displayed by the cellular device and this card provides the links to the other cards of the deck. 

<wml>

<card id="Card1" title="Learning WML ">

<p>

Welcome to Unwired World!

</p>

</card>

</wml>

WML card starts with <card>and ends with </card> tag. Attribute "id" of card element gives the identity to the card and using this id we can refer any card in the WML page. Next is <p> tag which we are using to display the paragraph. We can use <p>, <b>, <i>, <br>, <a> in our programming and these tags are identical to the HTML tags.   

Tags Functionality
<p> Writing paragraph
<b> Writing bold text
<i> Writing italic text
<br> Inserts a line break
<a> Creates a link

By the end of this chapter you are very much familiar with the WML language. Now try the follwing WML script which uses the different formating tags. You can test your script by copying and pasting the code in above text area and pressing the test button.

<?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="Card1" title="Learning WML ">

<p>

Welcome to Unwired World! <br/> Line break<br/>

<b>This is bold.</b><br/>
<i>This is italic.</i><br/>
<b>This is bold.</b><br/>
<u>This is underline.</u><br/>
<small>This is small.</small><br/>
<strong>This is strong.</strong><br/>
</p>  

</card>

</wml>

Now write your own scripts and test it.

In the next section you will learn how to write more than one cards in a deck and define the navigational links between them. 

   
  

Tutorial

    

» View all related tutorials
Related Tags: c debugging mac web api testing email tools com image ide table ant data discussion application debug io view download

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.