Приглашаем посетить
Литература (lit-info.ru)

21.1 An introduction to Mobile Internet

Table of Contents

Previous Next

21.1 An introduction to Mobile Internet

21.1.1 What are Mobile Internet and WAP?

By now, most of us are familiar with XHTML, the Web, and have considerable experience on the Internet. Some of you may also have rich experience in online business or e-commerce. Writing business Web pages and building practical Web sites are part (or will be, if not yet) of our daily lives. There is no doubt that business on the Internet is a fast-growing business. At the same time, have you noticed that another information technology (IT) is going to revolutionize our way of life and how we work, play, and communicate? That is, the mobile or wireless revolution!

If you compare the number of mobile phones that people own around the world to the number of computers, you will find an unbalanced result. In terms of applications, the time people spend on mobile phones is far more than on their computers. Also, in many parts of the world, it is already difficult to find a family without a mobile phone. For personal security and many other reasons, you may find it hard to live without one. Together with the Color Screen Phone (CSP), Personal Data Assistant (PDA), and other wireless devices, the entire mobile business or m-business has become a huge success in a relatively short time.

Now, mobile business is far beyond the functionality of a traditional phone. The industry can offer uncompromising information services and online business to its mobile users and is in many ways similar to the Web community. We call it the Mobile Internet.

In fact, the structure and style of the Mobile Internet is similar to the Web community. From a functional point of view, they have the one-to-one correspondence shown in Table 21.1.

Table 21.1. The Web and WAP community

Web community

Mobile Internet (WAP) community

Internet

Mobile Internet

TCP/IP protocol

Wireless Application Protocol (WAP)

XHTML language

Wireless Markup Language (WML)

ECMAScript

Wireless Markup Language Script (WMLScript)

Web site

WAP site (or WML site)

Web page

WAP page (or WML page)

Browser

Micro-browser (or WAP browser)

W3C authority

WAP Forum (www.wapforum.org)


Similar to the Web situation, mobile phones are equipped with a browser that is much smaller than IE or NS and is therefore called a micro-browser. The micro-browser can request a Wireless Application Protocol (WAP) page from a WAP site on the Mobile Internet. WAP pages are usually written in a language called Wireless Markup Language (WML) which is similar to XML. The WAP standard and languages are maintained by an industry association called the WAP Forum (www.wapforum.org). To describe WAP, nothing is more accurate than the description used in the official site of the WAP Forum:

The de facto worldwide standard for providing Internet communications and advanced telephony services on digital mobile phones, pagers, personal digital assistants (PDA) and other wireless terminals.

(www.wapforum.org)

WAP is a global standard and driving force for Mobile Internet applications. Since the markup language used in WAP is WML, we generally refer to WAP sites and pages in the same way as to WML.

21.1.2 How does the Mobile Internet work?

Basically, WAP provides browsing capabilities on the Mobile Internet similar to the Web. The main difference is that WAP is designed to accommodate the following drawbacks from a small device such as a mobile phone:

  • Limited memory

  • Small screen

  • Low bandwidth

  • Unreliable and high latency connections

Based on WAP, the WAP Forum created the new markup language called WML. People can use this language to write WAP pages and display them on a mobile phone with a micro-browser. The WML language is similar to XML but with a restrictive syntax. WML (or WAP) pages usually have a file extension .wml and are stored on a WAP site. A mobile phone or other wireless device with a micro-browser can request a WML page via the WAP gateway and display it. The usual architecture of the Mobile Internet is shown in Fig. 21.01.

Figure 21.1. Mobile Internet architecture

graphics/21fig01.gif


A typical Mobile Internet session or operation can be summarized as:

  • The micro-browser asks the WAP gateway for a WML page at a specific URL.

  • The WAP gateway transfers the request to the Web server for the WML page located in the URL.

  • The Web server returns the wml deck (WML page) to the WAP gateway.

  • The WAP gateway compiles and sends a binary form of wml (byte code) to the micro-browser.

  • The micro-browser processes the returned information and displays it.

Don't worry too much about the technical terms at this moment. We will guide you through all the processes and provide a comprehensive background for the Mobile Internet.

In particular, we focus on writing WML pages using WML v1.x and WML v2.x specifications so that pages can be displayed on almost all wireless devices. The version 1.x of WML is widely accepted and used by the mobile industry including almost all mobile phones and devices.

In addition to backward compatibility, WML v2.x has adopted a special version of XHTML known as XHTML-Basic as its default language. This new feature greatly enhances the integration of the WAP and Web communities. XHTML-Basic also includes a special version of the WAP Cascading Style Sheet (WCSS) so that styles can be defined in a WAP sense. XHTML-Basic requires more processing power and memory from your devices; it is targeted for high-end mobile devices such as the CSP, PDA, and smart phones (e.g., PDA + mobile phone).

The connection between the WAP gateway and the Mobile Internet community is actually an ordinary HTTP connection (i.e., Web). In fact the usual Web server can be modified to deliver WML pages to the micro-browser through the WAP gateway. We will show you how to do this in section 20.2.2.

Since the WAP gateway can request documents from Web servers, all CGI techniques that we have learned can be applied. As long as the server returns WML pages to the WAP gateway, the Mobile Internet session is considered as valid. In this case, all server scripts such as Perl, ASP, PHP, and database techniques are all in the same system.

The main function of the WAP gateway is to compile the WML page into byte code. The process is similar to the idea of Java. The byte code is then transmitted to the mobile phone or wireless device. The micro-browser is actually a byte code interpreter to display the byte code on the screen (small screen). Now, let's develop some WML (or Mobile Internet) pages.

21.1.3 My very first Mobile Internet pages

Without knowing all the details, our first Mobile Internet page is a very simple one. It is a WML page to display "Hello World" on your mobile phone screen. Consider the following coding:



Example: ex21-01.wml - My First Mobile Internet Page

 1: <?xml version="1.0"?>
 2: <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
 3: "http://www.wapforum.org/DTD/wml_1.3.xml">
 4: <wml>
 5:  <card id="card1" title="Welcome Message">
 6:     <p>Hello World! <br />
 7:        I know how to write<br />
 8:        WML pages too!</p>
 9:  </card>
10: </wml>

The first three lines of the page define the heading for every WML page. In particular, the statement in line 3

http://www.wapforum.org/DTD/wml_1.3.xml

specifies that we are using the WML v1.3 standard defined by the WAP authority, i.e., the WAP Forum (www.wapforum.org).

The element <wml> in line 4 defines the beginning of the page. Inside this page, we have only one card specified by the element <card> in lines 59. The title of this card is "Welcome Message." The title of the card will be displayed at the top of your mobile screen. The contents of this card (lines 68) are some messages to be displayed on your mobile screen. They are, in fact, elements of XHTML and can be understood easily.

This page illustrates one important thing about WML: the contents of a WML page are formed by a series of cards. That is why WML applications are also known as a card deck.

If you put this page into a server capable of delivering WAP pages, you can use your mobile phone to browse the page with the URL

http://www.pwt-ex.com/ex21-01.wml

provided the site www.pwt-ex.com can deliver WML pages. A screen shot of this page on your mobile may look like that in Fig. 21.2.

Figure 21.2. My first WML page

graphics/21fig02.gif


Using WML, your mobile phone can display images too. Consider the following WML page:



Example: ex21-02.wml - My First Mobile Internet Image

 1: <?xml version = "1.0"?>
 2: <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
 3: "http://www.wapforum.org/DTD/wml_1.3.xml">
 4: <wml>
 5:  <card id = "index" title = "Mobile Internet">
 6:  <p align="center">
 7:     IMAGE<br />
 8:     <img src="logo.wbmp" alt="pic" />
 9:   </p>
10:  </card>
11: </wml>

This is another simple WML page containing one card and one paragraph <p>. Inside the paragraph, there is one word "IMAGE" and an image element



<img src="logo.wbmp" alt="pic" />

The usage of this element is almost identical to the image element <img> used in XHTML. The only difference is that in WML version 1 only one image format is supported. That is the Wireless BMP (or WBMP) with the file extension .wbmp. This example is shown in Fig. 21.3.

Figure 21.3. Mobile Internet image

graphics/21fig03.gif


As you may ask, how can we develop WML or Mobile Internet pages effectively if we need to use our mobile phone to see the page all the time? Can we have some tools to simulate the micro-browser? Yes! The simulation tool is called the Mobile Internet Toolkit.

    Table of Contents

    Previous Next