You are on page 1of 34

Dr.

Akhilesh Das Gupta Institute of Technology


& Management
New Delhi

Mobile Computing Lab


ETEC – 454

Submitted To: Submitted By:


Prof. (Dr.) Surender Dhiman Abhishek
Department of ECE 00196207317, F-14
ADGITM B.Tech. ECE 8th Semester
INDEX
S.No. Name of the Experiment Remarks

1. Introduction to WAP proof software & implement program of


displaying message on screen using WML

2. Program to implement WML program to display images

3. Program to implement WML deck with two cards - one for user input
and one for displaying the result.

4. Program to implement WML Card can be set up to display the fieldset


function of WML

5. Program to implement for Text Formatting using WML

6. Program to elaborate different table properties in WML


7. Program to implement use of break attributes in WM

8. Program to implement A WML Card can be let a user enter information

9. Program to implement for selecting multiple list using WML

10. Program for selecting only one option using WML

11. Program to implement Timer in WML

12. Program to implement href tag to navigate from one card to other
Instructions for Laboratory Teachers
1. Submission related to whatever lab work has been completed should be done during the
next lab session.

2. The immediate arrangements for printouts related to submission on the day of practical
assignments.

3. Students should be taught for taking the printouts under the observation of lab teacher.

4. The promptness of submission should be encouraged by way of marking and evaluation


patterns that will benefit the sincere students.
EXPERIMENT No. 1
AIM: Introduction to WAP proof software & implement program of displaying message on screen
using WML.

OBJECTIVE: To learn WAP proof software and display message using WML.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

What is WAP?

The wireless industry came up with the idea of WAP. The point of this standard was to show
internet contents on wireless clients, like mobile phones.

 WAP stands for Wireless Application Protocol


 WAP is an application communication protocol
 WAP is used to access services and information
 WAP is inherited from Internet standards
 WAP is for handheld devices such as mobile phones
 WAP is a protocol designed for micro browsers
 WAP enables the creating of web applications for mobile devices.
 WAP uses the mark-up language WML (not HTML)
 WML is defined as an XML 1.0 application

What is WML?

WML stands for Wireless Markup Language. It is a mark-up language inherited from HTML, but
WML is based on XML, so it is much stricter than HTML.

WML is used to create pages that can be displayed in a WAP browser. Pages in WML are called
DECKS.

Decks are constructed as a set of CARDS.

What is WMLScript?

WML uses WMLScript to run simple code on the client. WMLScript is a light JavaScript language.
However, WML scripts are not embedded in the WML pages. WML pages only contains
references to script URLs. WML scripts need to be compiled into byte code on a server before
they can run in a WAP browser.
WAP BASICS
WAP Homepages

WAP homepages are not very different from HTML homepages. The markup language used for
WAP is WML (Wireless Markup Language). WML uses tags - just like HTML - but the syntax is
stricter and conforms to the XML 1.0 standard.

WML pages have the extension *.WML, just like HTML pages have the extension *.HTML.

WML Tags

WML is mostly about text. Tags that would slow down the communication with handheld devices
are not a part of the WML standard. The use of tables and images is strongly restricted.

Since WML is an XML application, all tags are case sensitive (<wml> is not the same as <WML>),
and all tags must be properly closed.

WML Decks and Cards

WML pages are called DECKS. They are constructed as a set of CARDS, related to each other
with links. When a WML page is accessed from a mobile phone, all the cards in the page are
downloaded from the WAP server. Navigation between the cards is done by the phone computer
- inside the phone - without any extra access trips to the server.

PROGRAM:

Hello World Program in Wml

<wml>

<card id="no1" title="Card 1">

<p>Hello World!</p>

</card>

</wml>
Result:

Conclusion: Hence we have studied WAP proof software and WML program to display a
message.
EXPERIMENT No. 2
AIM: Program to implement WML program to display images.

OBJECTIVE: To learn displaying image using WML.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <img> element is used to include an image in a WAP card. WAP-enabled wireless devices
only supported the Wireless Bitmap (WBMP) image format.

WBMP images can only contain two colors: black and white. The file extension of WBMP is
".wbmp" and the MIME type of WBMP is "image/vnd.wap.wbmp".

The <img> element supports the following attributes:

Attribute Value Description

align Alignment of the image


top
middle
bottom

alt alternative text Sets an alternate text to be displayed if the image


is not displayed.

height Height of the image in pixels or percentage. If you


px
specify the value in pixels, the syntax is "140",
% instead of "140px".

hspace Sets white space to the left and right of the image.
px
If you specify the value in pixels, the syntax is
% "140", instead of "140px".

localsrc cdata Sets an alternate representation for the image. If


this attribute is set, the browser will use it instead
of the "src" attribute.

src image url A path to wbmp image.

vspace Sets white space above and below the image. If


px
you specify the value in pixels, the syntax is "140",
% instead of "140px".

width Sets the width of the image.If you specify the


px
value in pixels, the syntax is "140", instead of
% "140px".

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

PROGRAM:

<wml>

<card title="Image">

<p>

This is an image

<img src="../images/stickman.wbmp" alt="stickman"/>

in a paragraph

</p>

</card>

</wml>
Result:

Conclusion: Hence we have implemented WML program to display image.


EXPERIMENT No. 3
AIM: A WML deck with two cards - one for user input and one for displaying the result.

OBJECTIVE: To learn WML deck and Cards.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The Deck

<wml> ......</wml>

The deck is the WML document itself. It is embedded within <wml> tags

The Cards

<card>...... </card>

Cards are always displayed one at the time. This WML deck contains two cards - one for user input
and one for displaying the result.

The <do> element

<do> .... </do>

The first card has a <do> element that defines an event to be triggered. The type="accept"attribute
of the <do> element causes the label="Answer" to be displayed in the lower left corner of the
display.

The Event

The <go> element triggers when the user clicks the <do> label. The href="#card2" attribute of the
<go> element causes card2 to be displayed on the screen.

PROGRAM:

<wml>

<card id="card1" title="Tutorial">

<do type="accept" label="Answer">

< go href="#card2"/>
</do>

<p><select name="name">

<option value="HTML">HTML Tutorial</option>

<option value="XML">XML Tutorial</option>

<option value="WAP">WAP Tutorial</option>

</select></p>

</card>

<card id="card2" title="Answer">

<p>You selected: $(name)</p>

</card>

</wml>

Result:
Conclusion: Hence we have implemented WML program to display image.
EXPERIMENT NO. 4
AIM: A WML Card can be set up to display the fieldset fuction of wml.

OBJECTIVE: To learn WML field set function.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <fieldset/> element is used to group various input fields or selectable lists.

Attributes:

This element supports the following attributes:

Attribute Value Description

title text Sets a title for the list

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

PROGRAM:

<wml>
< card title="Input">

<p>

<fieldset title="CD Info">

CD: <input name="cd" type="text" size="10"/>

Prize: <input name="prize" type="text" size="10"/>


</fieldset>

</p>

</card>

</wml>

Result:

Conclusion: Hence we have implemented a fieldset function of WML.


EXPERIMENT No. 5
AIM: A WML Program for Text Formatting

OBJECTIVE: To learn WML different Text Formatting.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <pre> element is used to specify preformatted text in WML. Preformatted text is text of which
the format follows the way it is typed in the WML document.

This tag preserves all the white spaces enclosed inside this tag. Make sure you are not putting this
tag inside <p>...</p>

The <pre> element supports following attributes:

Attribute Value Description

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

WML does not support <font> element, but there are other WML elements, which you can use to
create different font effects like underlined text, bold text and italic text, etc.

These tags are given in the following table:

WML Elements Purpose

<b> Defines bold text

<big> Defines big text


<em> Defines emphasized text

<i> Defines italic text

<small> Defines small text

<strong> Defines strong text

<u> Defines underlined text

PROGRAM:

<wml>

<card title="Formatting">

<p>

normal<br/>

<em>emphasized</em><br/>

<strong>strong</strong><br/>

<b>bold</b><br/>

<i>italic</i><br/>

<u>underline</u><br/>

<big>big</big><br/>

<small>small</small><br/>

</p>

</card>

</wml>
Result:

Conclusion: Hence we have implemented text formatting in WML.


EXPERIMENT No. 6
AIM: A Program to elaborate table properties in WML.

OBJECTIVE: To learn WML different table properties.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <table> element along with <tr> and <td> is used to create a table in WML. WML does not
allow the nesting of tables

A <table> element should be put with-in <p>...</p> elements.

The <table /> element supports the following attributes:

Attribute Value Description

columns number Sets the number of columns in the table

align To specify the horizontal text alignment of the


L
columns, you need to assign three letters to the align
C attribute. Each letter represents the horizontal text
alignment of a column. The letter can be L, C, or R.
R For example, if you want the following settings to be
applied to your table:

First table column -- Left-aligned

Second table column -- Center-aligned

Third table column -- Right-aligned

Then you should set the value of the alignattribute


to LCR.

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.


PROGRAM:

<wml>

<card title="Table">

<p>

<table columns="3">

<tr>

<td>Cell 1</td>

<td>Cell 2</td>

<td>Cell 3</td>

</tr>

</table>

</p>

</card>

</wml>

Result:

Conclusion: Hence we have implemented table properties in WML.


EXPERIMENT NO. 7
AIM: Program for use of break attributes in WML.

OBJECTIVE: To learn WML break attribute.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <br /> element defines a line break and almost all WAP browsers supports a line break
tag.

The <br /> element supports the following attributes:

Attribute Value Description

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

PROGRAM:

<wml>

<card title="Paragraphs">

<p>

This is a paragraph

</p>

<p>

This is a another<br/>with a line break

</p>

/card>
</wml>

Result:

Conclusion: Hence we have implemented break attribute in wml.


EXPERIMENT No. 8
AIM: A WML Card can be let a user enter information.

OBJECTIVE: To learn WML input tag.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <input/> element is used to create input fields and input fields are used to obtain
alphanumeric data from users.

This element support the following attributes:

Attribute Value Description

name text The name of the variable that is set with the
result of the user's input

maxlength number Sets the maximum number of characters the


user can enter in the field

emptyok Sets whether the user can leave the input field
true
blank or not. Default is "false"
false

format A Sets the data format for the input field. Default
a is "*M".
N
X A = uppercase alphabetic or punctuation
x
characters
M
a = lowercase alphabetic or punctuation
m
characters
*f
nf N = numeric characters
X = uppercase characters
x = lowercase characters
M = all characters
m = all characters
*f = Any number of characters. Replace
the fwith one of the letters above to specify
what characters the user can enter
nf = Replace the n with a number from 1 to 9
to specify the number of characters the user
can enter. Replace the f with one of the letters
above to specify what characters the user can
enter

size number Sets the width of the input field

tabindex number Sets the tabbing position for the select element

title text Sets a title for the list

type Indicates the type of the input field. The default


text
value is "text". Password field is used to take
password
password for authentication purpose.

value text Sets the default value of the variable in the


"name" attribute

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.


PROGRAM:

<wml>

<card title="Input">

<p>

Name: <input name="Name" size="15"/><br/>

Age: <input name="Age" size="15" format="*N"/><br/>

Sex: <input name="Sex" size="15"/>

</p>

</card>

</wml>

Result:

Conclusion: Hence we have implemented input tag in WML.


EXPERIMENT No. 9
AIM: WML program for selecting multiple list.

OBJECTIVE: To learn WML select element.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <select>...</select> WML elements are used to define a selection list and the
<option>...</option> tags are used to define an item in a selection list. Items are presented as
radiobuttons in some WAP browsers. The <option>...</option> tag pair should be enclosed
within the <select>...</select> tags.

This element support the following attributes:

Attribute Value Description

iname text Names the variable that is set with the index result
of the selection

ivalue text Sets the pre-selected option element

multiple Sets whether multiple items can be selected. Default


true
is "false"
false

name text Names the variable that is set with the result of the
selection

tabindex number Sets the tabbing position for the select element

title text Sets a title for the list


value text Sets the default value of the variable in the "name"
attribute

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.


PROGRAM:

<wml>

<card id="card1" title="Selectable List 3">

<p>

<select name="name" multiple="true">

<option value="HTML">HTML Tutorial</option>

<option value="XML">XML Tutorial</option>

<option value="WAP">WAP Tutorial</option>

</select>

</p>

</card>

</wml>

Result:

Conclusion: Hence we have implemented select element in WML.


EXPERIMENT No. 10
AIM: Program for selecting only one option.

OBJECTIVE: To learn WML select element.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <select>...</select> WML elements are used to define a selection list and the
<option>...</option> tags are used to define an item in a selection list. Items are presented as
radio buttons in some WAP browsers. The
<option>...</option> tag pair should be enclosed within the
<select>...</select> tags.
This element support the following attributes:

Attribute Value Description

iname text Names the variable that is set with the index result
of the selection

ivalue text Sets the pre-selected option element

multiple Sets whether multiple items can be selected. Default


true
is "false"
false

name text Names the variable that is set with the result of the
selection

tabindex number Sets the tabbing position for the select element

title text Sets a title for the list

value text Sets the default value of the variable in the "name"
attribute

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.


PROGRAM:

<wml>

<card id="card1" title="School">

<p>

<select name="name">

<option value="HTML">HTML Tutorial</option>

<option value="XML">XML Tutorial</option>

<option value="WAP">WAP Tutorial</option>

</select>

</p>

</card>

Result:

Conclusion: Hence we have implemented select element in WML.


EXPERIMENT No. 11
AIM: WML Program for Timer.

OBJECTIVE: To learn timer element .

TOOLS REQUIRED: WAP Proof Software.

THEORY:

A timer is declared inside a WML card with the <timer> element. It must follow the <onevent>
elements if they are present. (If there are no <onevent> elements, the <timer> must be the first
element inside the <card>.) No more than one <timer> may be present in a card.

The <timer> element supports the following attributes:

Attribute Value Description

name text Sets a name for the element.

value number Specifies the timer after which timer will be expired.
Timeouts are specified in units of a tenth of a second.

class class_data Sets a class name for the element.

id element A unique ID for the element.


ID

PROGRAM:

<wml>

<card ontimer="a.wml">

<timer value="30"/>

<p>Some Message</p>

</card>

</wml>
Result:

Conclusion: Hence we have implemented timer element in WML.


EXPERIMENT No. 12
AIM: WML Program for href.

OBJECTIVE: To learn href element.

TOOLS REQUIRED: WAP Proof Software.

THEORY:

The <anchor>...</anchor> tag pair is used to create an anchor link. It is used together with other
WML elements called <go/>, <refresh> or <prev/>. These elements are called task elements
and tell WAP browsers what to do when a user selects the anchor link

You can enclose Text or image along with a task tag inside <anchor>...</anchor> tag pair.

The <anchor> element supports the following attributes:

Attribute Value Description

title cdata Defines a text identifying the link

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

The <a>...</a> tag pair can also be used to create an anchor link and always a preferred way
of creating links.

You can enclose Text or image inside <a>...</a> tags.

The <a> element supports the following attributes:

Attribute Value Description

href URL Defines URL of the liked page


title cdata Defines a text identifying the link

xml:lang language_code Sets the language used in the element

class class data Sets a class name for the element.

id element ID A unique ID for the element.

As the name suggests, the <go> task represents the action of going to a new card.

The <go> element supports the following attributes:

Attribute Value Description

href URL Gives the URL of the new card. Relative URLs are
resolved relative to the current card

method Specifies the method that should be used to fetch


get
the deck. This must be one of the values get or
post post, corresponding to the GET and POST methods
of HTTP.
When using method="get", the data is sent as
an request with ? data appended to the url. The
method has a disadvantage, that it can be used
only for a limited amount of data, and if you send
sensitive information it will be displayed on the
screen and saved in the web server's logs. So do
not use this method if you are sending password
etc.

With method="post", the data is sent as an


request with the data sent in the body of the
request. This method has no limit, and sensitive
information is not visible in the URL

sendreferer If set to true, the browser sends the URL of the


true
current deck along with the request. This URL is
false sent as a relative URL if possible. The purpose of
this is to allow servers to perform simple access
control on decks, based on which decks are linking
to them. For example, using HTTP, this attribute is
sent in the HTTP Referer header.

accept- charset_list Specifies a comma- or space-separated list of


charset character sets that can encode data sent to the
server in a POST request. The default value is
"unknown".

class class data Sets a class name for the element.

id element ID A unique ID for the element.

PROGRAM:

<wml>

<card id="firstcard" title="One">

<do name="go" type="accept" label="Go">

<go href="#thirdcard"/>

</do>

<p>

This is the first card

</p>

</card>

<card id="secondcard" title="Two">

<p>

This is the second card

</p>

</card>

<card id="thirdcard" title="Three">

<p>

This is the third card

</p>

</card>

<card id="fourthcard" title="Four">


<p>

This is the fourth card

</p>

</card>

</wml>

Result:

Conclusion: Hence we have implemented timer element in WML.

You might also like