WML & WAP Programming
WML & WAP Programming
Sifal,Kathmandu
1
Student’s Declaration
I hereby declare that this assignment is my original work, and I have referenced all sources as
required. I understand that failure to adhere to academic integrity will result in disciplinary
action.
Signature:
Date: 2025/01/30
2
Table of Content
Title:...........................................................................................................................................1
Student's Declaration:..............................................................................................................2
Introduction.:............................................................................................................................4
Task 1 WML& WAP Fundamental:......................................................................................5
Task 2 WAP Architecture and Features..............................................................................17
Task 3 WAP Advantages and Limitation:...........................................................................24
Task 4 Practical Project:.......................................................................................................28
Task 5 Conclusion:.................................................................................................................33
Task 6 References:..................................................................................................................34
Task 7 Appendices:................................................................................................................35
List of Figures
Figure 1....................................................................................................................................29
3
Introduction
With the rapid growth of mobile technology, the need for efficient, user-friendly, and mobile-
compatible web pages has become essential. Mobile web technologies, particularly Wireless
Markup Language (WML) and the Wireless Application Protocol (WAP), play a crucial role
in designing web pages that cater to mobile users. This assignment provides a hands-on
approach to understanding the key elements of WML, implementing navigation and user
interaction features, and evaluating the performance of mobile web pages across different
devices and network conditions. While mobile web technologies offer benefits such as
enhanced accessibility and seamless user experience, challenges like device compatibility,
network limitations, and optimization complexities must be addressed. By designing, testing,
and analyzing WML-based web pages, students will gain practical knowledge of mobile web
development and wireless communication protocols.
4
Task 1: WML & WAP Fundamentals (Chapter 1)
Questions:
1. What are the main differences between WML and HTML?
Ans:In the context of WML (Wireless Markup Language) and HTML (HyperText Markup
Language), here are the main differences:
Feature WML (Wireless Markup HTML (HyperText
Language) Markup Language)
5
Data Formatting Simplified formatting for Supports advanced styling
low-performance devices and through CSS and dynamic
slow networks content with JavaScript
This table provides a clear comparison of WML and HTML based on their key features
Ans:A WAP Gateway (Wireless Application Protocol Gateway) plays a critical role in
facilitating communication between mobile devices (such as mobile phones) and the internet.
Here’s an explanation of its role:
1. Protocol Translation:
- Primary Role: The WAP Gateway acts as an intermediary between the WAP (Wireless
Application Protocol) used by mobile devices and the HTTP (HyperText Transfer Protocol)
used on the internet.
- It translates WAP requests from mobile devices into HTTP requests that can be understood
by web servers and translates the response back from HTTP to WAP for the mobile device.
2. Content Optimization:
- The WAP Gateway optimizes the content for mobile devices. Since mobile phones have
limited resources (small screens, low processing power, and slow network speeds), the WAP
Gateway reformats or reduces the size of web content to make it more suitable for mobile
browsing.
- This ensures that content is efficiently delivered to mobile devices, providing faster loading
times.
6
- WAP Gateways often compress content to reduce the data size transmitted over wireless
networks, improving performance and reducing costs associated with mobile data usage.
- They may also handle encoding to ensure compatibility with different device capabilities,
such as encoding images or compressing text content.
7
Summary of WAP Gateway's Role
Function Description
Protocol Translation Converts WAP requests to HTTP and vice
versa
Content Optimization Reformats content for mobile devices,
reducing data usage
Compression & Encoding Compresses content and encodes it for
mobile devices
Security & Access Control Provides encryption, authentication, and
access filtering
Routing & Data Management Routes requests between mobile devices and
web servers
In essence, the WAP Gateway ensures that mobile devices can access web content in an
optimized, secure, and efficient manner, making mobile web browsing possible despite the
limitations of the devices and networks involved.
Description: This is the device that requests and receives content over a wireless network. It
can be a mobile phone, PDA, or any wireless device that supports WAP.
Key Features:
- Uses a WAP browser to interpret WML (Wireless Markup Language).
- Interacts with the WAP Gateway for accessing web services and mobile content.
8
2. WAP Gateway (WAP Gateway/Proxy)
Description: The WAP Gateway is the intermediary between the mobile device and the
internet. It translates WAP requests to HTTP and HTTP responses to WAP, optimizing data
transfer and ensuring compatibility between the mobile device and web servers.
Key Features:
- Protocol Translation (WAP to HTTP and vice versa).
- Content Optimization for mobile devices.
- Compression and Security (e.g., encryption and access control).
4. Application Server
Description: The Application Server hosts the application logic and processes the requests
made by the WAP Client. It may involve complex applications such as databases, business
logic, and user authentication.
Key Features:
- Executes dynamic content generation.
- Manages the interaction between the client and back-end services (e.g., databases).
- Ensures that the proper content is delivered to the mobile device.
5. Wireless Network
Description: The wireless network provides the communication infrastructure for the mobile
device to access the WAP Gateway and the internet. It includes mobile communication
technologies like GSM, GPRS, CDMA, or 3G.
Key Features:
- Supports low-bandwidth communication between the mobile device and the WAP Gateway.
- Ensures wireless data transmission in the mobile network.
6. Content Server
9
Description: A server that stores and delivers multimedia content (such as images, audio, and
video) to the WAP Client. The content is often adapted for mobile devices, ensuring
compatibility with their limited capabilities.
Key Features:
- Stores media files (images, audio, etc.) that mobile devices can access.
- Provides media adaptation to optimize content for mobile screens and low bandwidth.
WAP Client (Mobile Device) Device that requests and displays WAP
content (e.g., mobile phone)
10
Wireless Network Infrastructure for wireless communication
(GSM, GPRS, 3G, etc.)
These components work together to enable seamless wireless browsing, content delivery, and
mobile application access, optimized for the unique limitations of mobile devices and
networks.
Ans:WML (Wireless Markup Language) handles user input through a set of interactive
elements and events that allow mobile users to interact with the content on their devices.
These elements are designed to be lightweight and optimized for mobile environments with
small screens and limited input methods. Here's an explanation of how WML handles user
input:
1. Forms in WML:
- WML supports forms that allow users to provide input, similar to HTML forms. These
forms consist of input elements like text fields, radio buttons, checkboxes, and buttons.
- A form can be defined using the <form> tag, and each input field within the form is created
using tags such as <input>, <select>, and <textarea>.
11
<input type="text" name="userName" label="Enter Name"/>
<input type="text" name="userEmail" label="Enter Email"/>
</card>
- Radio Buttons and Checkboxes: These elements allow users to select options from a set of
choices. For instance:
- Radio buttons
<input type="radio" name="gender" value="male" label="Male"/>
<input type="radio" name="gender" value="female" label="Female"/>
- Checkboxes:
<input type="checkbox" name="subscribe" value="yes" label="Subscribe to newsletter
onenterforward: Triggered when the user submits the form or presses the "Enter" key.
onenterbackward: Triggered when the user navigates backward in the content.
12
onselect: Triggered when the user selects an option.
Example of a <do> tag for handling user input action:
<go href="nextpage.wml"/>
</do>
- After the user enters the data into the input fields, the form can be submitted to the server
for further processing. The server can then process the input, generate a response, and send it
back to the WML browser on the mobile device.
- The data entered in the form is usually sent as parameters in the URL or as post data to the
next page or server for further processing.
- WML itself does not have built-in input validation like HTML5, but basic validation can be
implemented by ensuring the user has entered information in the required fields before
submitting the form.
- You can also handle validation on the server-side after the user submits the form data.
<card id="inputCard">
13
<go href="nextcard.wml"/>
</do>
</card>
In this example:
- The form contains two text input fields: one for the user's name and another for the email.
- The <do> tag defines the action that will be triggered when the user submits the form (it
takes the user to nextcard.wml).
WML provides a basic yet effective way to gather and process user input on mobile devices,
keeping the design lightweight and suitable for low-resource environments.
1.Client-Side Scripting: Executes on the mobile device, reducing reliance on the server for
every user interaction.
2.Lightweight: Optimized for devices with limited processing power and memory, making it
efficient for mobile devices.
3.Interactivity: Adds dynamic behavior such as form validation, calculations, and conditional
navigation based on user input.
4.Integration with WML: Works alongside WML to add logic and functionality, while WML
handles the structure and layout of content.
14
- User Input Validation: WMLScript allows validating user input directly on the device
before submission. For example, checking if an age input is valid or if a user’s email format
is correct.
Example:
<script type="WMLScript">
function validateAge() {
var age = getVar("age");
if (age < 18) {
alert("You must be at least 18 years old.");
}
}
</script>
- Form Processing: It can process data entered by users into forms (e.g., calculating total
prices or submitting data conditionally).
Example:
<script type="WMLScript">
function calculateTotal(price, quantity) {
return price * quantity;
}
</script>
- Dynamic Navigation: WMLScript can control navigation based on user actions, such as
moving to different WML cards based on conditions.
Example:
<script type="WMLScript">
function goToNextCard() {
goTo("nextCard.wml");
}
</script>
15
- Control Flow: It supports basic control structures like conditionals (if, else) and loops to
make decisions based on user input or other factors.
WMLScript Syntax:
The syntax of WMLScript is C-like with variables, functions, and expressions.
It is embedded inside a WML page using the <script> tag within a <card> element.
Example of a complete WML and WMLScript integration:
<wml>
<card id="inputCard">
<p>Please enter your age:</p>
<input type="text" name="age" label="Age"/>
<do type="accept" label="Submit">
<go href="#nextCard"/>
</do>
<script type="WMLScript">
function validateAge() {
var age = getVar("age");
if (age < 18) {
alert("You must be at least 18 years old.");
} else {
goTo("nextCard.wml");
}
}
</script>
</card>
<card id="nextCard">
<p>Thank you for submitting your age!</p>
</card>
</wml>
16
Common Uses of WMLScript:
1.Form Validation: Ensures the user inputs are correct before submitting a form.
2.Calculations: Performs client-side calculations like multiplying price and quantity.
3.Conditional Navigation: Directs the user to different cards based on their selections or
inputs.
4.Improving User Experience: Adds dynamic behavior and reduces the need for frequent
server requests.
Limitations:
Limited Functionality: WMLScript is designed to be lightweight, so it lacks more complex
features found in other scripting languages like JavaScript.
Compatibility: It is only supported by WAP-enabled devices and is not compatible with
traditional web browsers.
Conclusion:
WMLScript plays an essential role in enhancing mobile web applications by enabling
interactive features and logic on mobile devices. It works alongside WML to provide
functionality like user input validation, calculations, and dynamic navigation, all while being
optimized for low-resource environments.
Ans: The Wireless Application Protocol (WAP) architecture is designed to enable mobile
devices (like mobile phones and PDAs) to access internet content and services efficiently,
even in environments with limited bandwidth, processing power, and memory. WAP
achieves this by using a layered structure that facilitates communication between mobile
devices and the internet, ensuring compatibility with various wireless networks and mobile
devices.
17
The WAP architecture consists of multiple layers and components that work together to
ensure the smooth flow of data between mobile devices and the internet. It has a client-server
architecture with five main layers, each with a specific function. These layers ensure that
mobile devices can access internet content optimized for their limitations.
18
2.WAP Gateway:
The WAP gateway acts as an intermediary between the mobile device and the web server. It
converts WAP-specific requests into standard HTTP requests for web servers and vice versa,
ensuring that the content is delivered in a mobile-friendly format (e.g., WML instead of
HTML).
4.Web Server:
A web server stores and serves the content requested by the mobile device. It delivers content
such as HTML pages, images, or other resources, which are then converted into a WAP-
compatible format by the WAP gateway.
5.Bearer Network:
The bearer network is the wireless network (e.g., GSM, GPRS, EDGE, 3G) that transmits
data between the mobile device and the WAP gateway. It ensures that data is transferred
wirelessly from the user’s device to the internet and back.
6.WAP Proxy:
A WAP proxy is an optional component that helps optimize content delivery by caching
frequently requested content and reducing the load on the web server. It speeds up access to
commonly used content by delivering cached responses.
1.Request Initiation:
A user on a mobile device opens a WAP browser and makes a request (e.g., requesting a
WML page) for internet content.
19
The mobile device sends the request to the WAP Gateway, using the WSP (Wireless Session
Protocol) for transport.
2.Protocol Conversion:
The WAP Gateway converts the WAP-specific request into an HTTP request that can be
understood by standard web servers.
The WAP Gateway may also compress data to optimize the response size and speed.
3.Data Transmission:
The Bearer Network (wireless network) transmits the request from the mobile device to the
WAP gateway and the content back from the gateway to the mobile device.
The wireless network supports data transfer over protocols like GSM, GPRS, or 3G.
4.Content Retrieval:
The WAP Gateway communicates with the web server to retrieve the requested content (such
as an HTML page).
The server sends back the content, which is usually in HTML format.
5.Content Transformation:
The WAP Gateway converts the HTML content into WML or a similar lightweight format
that can be displayed on mobile devices. This process ensures that the content is compatible
with the device’s small screen and limited resources.
7.User Interaction:
The user interacts with the content, and if necessary, sends further requests through the WAP
browser (e.g., submitting forms, navigating between WML cards, etc.).
The WAP architecture enables mobile devices to access internet content efficiently, despite
the constraints of mobile environments (such as limited bandwidth and processing power).
20
By using specialized protocols and components like the WAP Gateway, WML, and the
Bearer Network, WAP ensures that mobile users can interact with the web in a way that is
optimized for their devices and network conditions.
2. Describe the key features and elements of WML, and explain how it differs from
HTML.
2.Card-based Structure:
- WML uses a card-based structure for organizing content. A WML document consists of
cards, which are individual pages or sections of content that the user can interact with. Each
card represents a discrete screen or page.
- Cards are typically linked together to create a sequence or flow of content, similar to HTML
pages, but designed to be navigated in a linear way on mobile devices.
3.User Interaction:
- WML supports interactive elements such as forms (with input fields), links for navigation,
and buttons for submitting data or navigating between cards.
- WML allows for the creation of interactive menus, where users can select options and
navigate through the content.
21
- Unlike HTML, WML has minimal styling options and supports basic elements such as text,
images, and links. It does not have advanced layout features like CSS.
- WML pages are designed for easy readability and interaction on small screens, focusing on
functionality rather than complex visual appearance.
6.Scripting Support:
- WML includes support for WMLScript, a lightweight scripting language used to add
interactivity, logic, and client-side behavior to WML documents. WMLScript is used to
handle events such as user input and navigation within the WML cards.
Element Description
<wml> The root element of a WML document that
defines the WML page.
<card> Defines a single "page" or screen of content
in the WML document. Cards are used to
organize content.
22
text fields, checkboxes, or radio buttons.
23
network bandwidth. resolution, and reliable
network speeds.
WML is a specialized language for creating web content optimized for mobile devices,
focusing on simplicity, minimalism, and low-bandwidth environments. Unlike HTML, which
is designed for the rich, feature-filled websites used on desktop computers, WML is a
compact, streamlined language that delivers text and basic interactivity on mobile devices.
The primary goal of WML is to provide a functional, efficient browsing experience on
devices with limited screen space, processing power, and network connectivity, while HTML
focuses on creating detailed and visually rich content for larger screens and more powerful
devices.
Ans:Wireless Application Protocol (WAP) was designed to provide internet access on mobile
devices with limited resources, such as small screens, limited memory, and low processing
power. While WAP offered significant advantages for mobile internet access in its time, it
also had certain limitations. Below is a comprehensive analysis of the advantages and
limitations of using WAP for mobile internet access.
24
WAP is specifically designed for mobile devices with smaller screens and limited processing
power. It ensures that web content is optimized for mobile interfaces, with lightweight and
simple markup languages like WML (Wireless Markup Language), which is faster to load
and easy to display on mobile devices.
25
Since WAP minimizes the data load by compressing and simplifying web content, it helps
reduce the cost of mobile internet services for service providers. It also helps reduce
congestion on mobile networks by ensuring efficient data transmission.
26
dynamic, interactive websites. This limits the potential of WAP for creating complex,
feature-rich applications.
However, WAP also had limitations, including limited multimedia support, a basic user
interface, and compatibility issues across different devices. As mobile networks and
technologies evolved, modern web standards such as HTML5 and responsive design have
largely replaced WAP, offering more rich, interactive, and multimedia-intensive web
experiences.
While WAP was a crucial step in the evolution of mobile internet, its limitations make it less
relevant in today’s world of high-speed mobile internet and advanced mobile browsers.
Task 4 : Practical Project
Create a mobile web application using Wireless Markup Language (WML) and Wire
less Application Protocol (WAP).
Your application must demonstrate the following features:
· Text formatting
27
· Tables and links
· Events and selection lists
· Password input fields
· Reset buttons and variable referencing
· Inter deck navigation
Test the application on various emulators and document your observations
Here's a step by step guide for creating a mobile web application using WML and WAP that
demonstrates the required features:
1. Application Design
The application is a simple User Registration Form that includes:
-Text formatting
-Tables and links
-Events and selection lists
-Password input fields
- Reset buttons
- Variable referencing
- Inter deck navigation
2. WML Code
Below is the WML code for the mobile web application:
28
Figure : 1
29
3. Key Features Demonstrated
- Text Formatting: The <b> tag is used to bold text.
- Tables and Links: A table is created with <table> and <tr> elements, and links are pro
vided using <a> tags.
- Events and Selection Lists:
Selection lists created using the <select> and <option> tags.
The <do> tag specifies actions triggered by user events like submitting data.
- Password Input Fields: <input type="password"> is used for secure input.
- Reset Buttons and Variable Referencing:
<do type="reset"> clears all form fields.
Variables like $(name) are used to display and process user input.
· Inter Deck Navigation:
Users can navigate between decks using <go href="#id">.
4. Testing the Application
To test the application:
1. Use a WAP emulator such as:
-Openwave SDK
-Kannel WAP Gateway
- WAP Emulators built into browsers like Opera (older versions).
- Install the emulator, configure it to use WAP, and load the .wml file.
Steps to Test:
1. Load the .wml file in the emulator.
2. Test navigation between decks.
3. Fill out the registration form and verify:
-Input handling for text, password, and dropdown.
- Reset button functionality.
-Inter deck navigation and variable referencing (e.g., displaying the user’s
name).
· Document any errors or issues during testing.
30
Events and Selection Lists:
Selection lists created using the <select> and <option> tags.
The <do> tag specifies actions triggered by user events like submitting data.
Password Input Fields: <input type="password"> is used for secure input.
Reset Buttons and Variable Referencing:
<do type="reset"> clears all form fields.
Variables like $(name) are used to display and process user input.
Inter Deck Navigation:
Users can navigate between decks using <go href="#id">.
4. Testing the Application
To test the application:
1. Use a WAP emulator such as:
· Openwave SDK
· Kannel WAP Gateway
· WAP Emulators built into browsers like Opera (older versions).
· Install the emulator, configure it to use WAP, and load the .wml file.
Steps to Test:
1. Load the .wml file in the emulator.
2. Test navigation between decks.
3. Fill out the registration form and verify:
-Input handling for text, password, and dropdown.
- Reset button functionality.
- Inter deck navigation and variable referencing (e.g., displaying the user’s
name).
-Document any errors or issues during testing.
31
Is the password field masked?
Performance:
Is the app responsive in low bandwidth scenarios?
Compatibility:
Test on different emulators to ensure cross device compatibility.
Example Observation Table:
Notes
32
-Ensure the WML file is hosted on a WAP enabled web server for real world testing.
- Use multiple emulators to identify compatibility issues across devices.
-WAP technology is largely obsolete, so testing might be limited to legacy systems or
simulators.
Task 5: Conclusion
Summarize the key learning from the assignment, reflecting on its relevance to your
academic and professional growth.
This assignment on creating a mobile web application using WML and WAP provided
valuable insights into the fundamentals of mobile internet technologies and their historical
development. By working with WML, I developed an understanding of how early mobile
applications were structured to overcome the limitations of mobile devices and networks,
such as restricted bandwidth, small display sizes, and limited processing power.
Implementing features like text formatting, user input handling, and interdeck navigation
demonstrated the efficiency and simplicity required to enhance user experiences within such
constraints.
A key learning experience was understanding the WAP architecture, particularly the role of
WAP gateways in facilitating communication between mobile devices and traditional internet
servers. Gaining insight into the layered protocol stack, covering transport, security, and
application layers, broadened my knowledge of communication protocols within mobile
networks.
Although WAP and WML are now obsolete, this assignment emphasized the evolution of
mobile web technologies, transitioning from early frameworks to modern standards like
33
HTML5 and responsive design. This underscores the importance of adaptability in the ever-
changing landscape of technology.
Task 6 : Reference
34
Task 7 : Appendices
35