Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Experiment No 6 Display Calculator Using WML: Theory

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Experiment No 6

Display Calculator Using WML

Part A
 Aim: Write a program using WML to display calculator and calendar
for android phone.

 Objectives: To study the WAP protocol and WML.

 Outcomes: After successful completion of this experiment


students will be able to develop and demonstrate mobile applications
using various tools

 Theory:

Wireless Application Protocol (WAP): WAP is a technical standard for


accessing information over a mobile wireless network. A WAP browser is a
web browser for mobile devices such as mobile phones that use the protocol.

WAP (Wireless Application Protocol) sites are also commonly referred to


as mobile sites. Mobile sites are mini versions of a website that has been
reconfigured so that the website layout is compatible with the smaller screens
of wireless mobile devices.

Wireless application protocol (WAP) is an application environment and set of


communication protocols for wireless devices designed to enable
manufacturer-, vendor-, and technology-independent access to the Internet and
advanced telephony services.

Wireless Application Protocol commonly known as WAP is used to enable


the access of internet in the mobile phones or PDAs. WAP is an
international standard for the devices that use the wireless
communications. ... All we have to do is to carry a WAP enabled mobile
phone or PDA.
Wireless Mark-up Language (WML)

 WML stands for wireless mark-up language, it is an application


of xml, WML document have an extension .wml
 WML takes care of small screen and low transmission bandwidth
 WML is mark-up language defined in WAP specification
 WAP sites are written in WML and websites are written in HTML

HTML VS WML

 The main difference between HTML and WML, in HTML basic


unit of navigation is page and basic unit of navigation in WML is
deck and card.

 WML pages are often called "decks". A deck contains a set of


cards. A card element can contain text, mark-up, links, input-
fields, tasks, images and more. Cards can be 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:

 Steps to run WML program:


Steps:
1) Write wml program in notepad and save it as filename.wml
2) To run wml program download; winwap browser for window
and Winwap smartphone browser Emulator or any other
emulator (to view how wap sites will look on mobile device)

3) To run the wml file double click the file, or do right click and
open with winwap browser and enter complete path of wml
file in address bar.
4) To run wml file on Winwap smartphone browser Emulator, follow the
given steps


 WML code

Calc.wml

<?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="Calculator" newcontext="true">

<p>

Value1: <br/><input format="N*M" name="amount1"

title="First Amount:"/> Operator : <br/><select

name="operator" value="ADD" title="Operation:">

<option value="ADD">Addition</option>

<option value="SUB">Subtraction</option>

<option value="MULT">Multiplication</option>

<option value="DIV">Division</option>

</select>

Value2: <br/><input format="N*M" name="amount2"

title="Second Amount:"/> Result : = <b>$(answer)</b>

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

<go href="calc.wmls#operation('answer',$(amount1),'$
(operator)',$(amount2))"/>

</do>

</p>
</card>

</wml>

Calc.wmls

extern function operation(result,val1,operate,val2)

{ var ans=0;

if (operate=='ADD')

ans = val1 + val2;

else if (operate=='SUB')

ans=val1 - val2;

else if (operate=='MULT')

ans=val1 * val2;

else

ans=val1 / val2;

WMLBrowser.setVar(result,ans);

WMLBrowser.refresh();

}
PART B
(PART B: TO BE COMPLETED BY STUDENTS)

(Students must submit the soft copy as per following segments within two
hours of the practical. The soft copy must be uploaded on the Blackboard
or emailed to the concerned lab in charge faculties at the end of the
practical in case the there is no Black board access available)

Roll. No. Name:

Class Batch:

Date of Experiment: Date of Submission:

Grade:

B.1 Software Code written by student:

(Paste your Code script related to your case study completed


during the 2 hours of practical in the lab here)

B.2 Input and Output:

(Paste your output that you are getting after running app in
from of screen shots and attach report after running
experiment)

B.3 Observations and learning:

(Students are expected to comment on the output obtained with


clear observations and learning for each task/ sub part
assigned)

B.4 Conclusion:

(Students must write the conclusion as per the attainment of


individual outcome listed above and learning/observation
noted in section B.3)

B.5Question of Curiosity

(To be answered by student based on the practical


performed and learning/observations)

1. Explain pros and cons of WML.

You might also like