Developing Mobile Web Application with .NET

Introduction:

This article presents a general idea of the WAP (Wireless Application Protocol) and developing mobile Web application with .NET. Let me first explain the basic principles of WAP and a sample WML code and the same code in the .NET Mobile Web SDK.

History of WAP:

WAP is a global standard and is not controlled by any single company. Ericsson, Nokia, Motorola, and Unwired Planet founded the WAP Forum in the summer of 1997 with the initial purpose of essential an industry-wide specification for developing applications over wireless communications networks.

At first Phone.com, Ericsson, Nokia and many others began developing standards separately of each other, but soon they understand that it would make more sense to focus improvement around a common standard. They all wanted to establish a common layout for Internet transfers to mobile telephones, without having to modify the Internet pages for the particular display on every different mobile telephone or personal organizer. With WAP Forum they were able to find such a protocol.

What is WAP?

The Wireless Application Protocol (WAP) is an open, global specification that empowers mobile users with wireless devices to easily access and interact with information and services right away.

The WAP is a specification for a set of communication protocols to standardize the way that wireless devices, such as cellular telephones and radio transceivers, can be used for Internet access, including e-mail, the World Wide Web, and newsgroups.

What is WAP Forum?

The WAP Forum is the industry association comprising over 500 members that has developed the in effect world standard for wireless information and telephony services on digital mobile phones and other wireless terminals.

The primary goal of the WAP Forum is to bring together companies from all segments of the wireless industry value chain to ensure product interoperability and enlargement of wireless market.


arun5.gif

The WAP architecture.

To access a Web site on a mobile phone, we have to type the URL in the browser. Using Wireless Transport Layer Security (WTLS), the mobile phone browser generates an encrypted URL request and sends it over Wireless Session Protocol (WSP) to a WAP gateway server. WSP is a variant of HTTP that transfers information in binary format, rather than text-based format.

The WAP gateway server interprets the request, translates it into a conventional HTTP request, and sends it to the Web server.

After getting the request, the Web server interprets it and determines which resources to retrieve or execute. If the URL indicates a file, the server sends the file to the client. If the URL indicates an ASP page, then the Web server executes the ASP code before sending the results to the WAP gateway server. In this method the returned content must be in the form of a WML document.

The gateway server removes the unnecessary headers, translates the WML document into binary, and sends the response to the mobile phone browser. The browser interprets the WML and displays it to the user. This is the architecture behind the WAP.

WML (WIRELESS MARKUP LANGUAGE)

WML (Wireless Markup Language), previously called HDML (Handheld Devices Markup Language), is a language that allows the text portions of Web pages to be presented on cellular phones and personal digital assistants (PDAs) via wireless access. WML is part of the Wireless Application Protocol (WAP) that is being proposed by several vendors to standards bodies. Any programmer with working knowledge of HTML, CGI scripts, and SQL queries should be able to write a presentation layer using WML. A filter program can be written or may be available from a vendor that will translate HTML pages into WML pages.

In summary the WML is

  1. Tag-based browsing language.
  2. Screen management (text, images).
  3. Data input (text, selection lists, etc.).
  4. Inherits technology from HDML and HTML.
  5. W3C XML-based language.
  6. Hyperlinks & navigation support.

. NET Mobile Web SDK:

In November 2000, Microsoft released Beta 1 of the .NET Mobile Web SDK.
After installing the .NET platform, install the .NET Mobile Web SDK. In this article I show you that how to create a simple mobile web application.

Let us see first how to create in WML language.

Let's see the typical Hello INDIA, as a mobile application written in WML.
Most important here is the header. The absolutely first character that is received by the browser must be the < character that starts the line <?xml version="1.0">. Any other characters, even a space or a carriage return or other will break the card.

<?xml version="1.0">
<!
DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
http://www.wapforum.org/STS/wml_1.1.xml>
<
wml>
<
card id="mycard" title="My first card arungg">
<
p>
HELLO,INDIA!
</p>
<
card>
</
wml>

Now let's see it implemented in the .NET Mobile Web SDK.

<%@ Page Inherits="System.Mobile.UI.MobilePage" Language="C#" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Mobile.UI" %>
<mobile:Form runat="server" ID="Form1" NAME="Form1">
<
mobile:Label runat="server" ID="Label1" NAME="Label1">
HELLO, INDIA!
</mobile:Label>
</
Mobile:Form>

Place this code in the Notepad and name it as HelloINDIA.aspx document in a virtual directory you create for Internet Information Services. It appears that, the code doesn't seem alike to WML. However the displayed result is the same.

MobileWebAppGAG0f1.jpg

The output is like the above one.

That's all in creating a simple Mobile Web application.

Conclusion

Using Visual Studio .NET, you will be able to develop Mobile Web applications easily. Microsoft has integrated the .NET Mobile Web SDK directly into the Visual Studio .NET environment and makes it easy to create Mobile Web applications.

I believe that this article provides you a little bit information about WAP, WML and creating Mobile Web applications.


Similar Articles