Wireless Applications with ASP.NET

The Internet is constantly evolving, and has moved from the desktop to include the wireless world. As an extension of ASP.NET, Microsoft has released the Mobile Internet Toolkit (MIT). MIT is an intelligent solution to produce mobile applications that detect the browsing device and return the appropriately formatted content. Thus, MIT provides a single application that adapts to Web-enabled cell phones, pagers, and personal digital assistants (PDAs).

Although the technology exists to extend your desktop applications to a mobile environment, you have to be aware of some of the limitations of mobile devices:

Smaller screen size: A typical cell phone can only display 15 to 20 characters across and between 4 to 6 lines of text.

Power: Most mobile devices have limited battery life, memory, and processing power, and do not carry the same capabilities as your desktop PC.

Bandwidth: By nature, wireless applications are more costly to run and, technically, cannot provide the bandwidth found on a wired network.

Luckily, MIT will handle most of the screen size limitations that you will run into when developing wireless applications. MIT will dynamically detect the device being used and provide the appropriate output.

In spite of the difficulties previously mentioned, MIT makes it easy to deploy wireless applications, and it does so intelligently.

Over 80 percent of Internet-enabled, wireless devices consist of cell phones and PDAs. Cell phones have a typical display screen of 15 to 20 characters and between 4 to 6 lines of text. PDAs are a little bit larger, and may be as wide as 20 to 25 characters, and include up to 6 to 10 lines of text.

Testing your applications on wireless devices could get to be expensive over the process of building your software. Therefore, to test your applications, this chapter explains how to use two different emulators: a cell phone emulator by Openwave, and the Pocket PC emulator available from Microsoft.

Openwave is one of the world's largest providers of mobile Internet software.

Because WAP is the protocol used to transfer our data, we need another protocol to format our data. That's where WML, or Wireless Markup Language, comes into play. WML is used to format pages that are delivered using WAP. WML has its roots in XML, and is in fact still XML-compliant.

Building Your First Mobile Application

Now that you understand the foundation of mobile applications, you will build your first application. Your sample application, about bicycling, will demonstrate various techniques of displaying data, and receiving input data from the user.

Static pages

Let's take our layout and convert it to an application. However, before we start coding, we need to make sure our Internet Information Server (IIS) is set up to properly serve WML pages. To configure IIS 5.0 on Windows 2000 to serve up static WML pages, follow these steps:

1. Open Control Panel, then Administrative Tools, then IIS administrator.

2. Right -click your Web site instance and select Properties.

3. Click the HTTP Headers tab.

4. Under Mime Types, click File Types.

5. Under Registered File Types, check to see if .wml is listed.

6. If .wml is not listed, click New Type to show the File Type dialog box.

7. Enter ".wml" (without quotes) in the Associated Extension box.

8. Enter "text/vnd.wap.wml" (without quotes) in the Content Type (MIME) box.

Building your first MIT page

MIT is considered an intelligent solution. It will detect what type of device is requesting data and will return the appropriately formatted data. For example, if a browser is requesting your mobile page, the respective HTML will be returned. If a cell phone is requesting your page, the appropriate WML will be returned. This happens because all mobile pages must inherit from System.Web.UI.MobileControls.MobilePage.

The object MobilePage is the outermost layer of all the containers in a mobile Web application.

Mobile Lists

Now that you've been introduced to some basic mobile controls, you will see how to use mobile lists. Mobile lists are one of the most powerful, and most popular mobile controls. They provide an easy way for the user to input data through their mobile device.

Simple lists

Let's take our example one step further and explore some other controls. This control is much more flexible than the standard tag, because it provides special commands and formatting features.

Pagination

Often times, we want to send more text to the client or device than what can fit on a single screen. After all, most cell phones are only around 15 characters wide and have 4 to 6 lines for text. Some devices have more room for display, some have less. So, how much text should you show at a time and for what device? Fortunately for us, MIT takes care of this by the way of pagination.

Pagination automatically formats the text to fit the device. By default, pagination is not turned on, or set to true.

Validating input

Some of the most powerful features of ASP.NET are the validation controls. MIT also has its own set of validation controls; however, these validation controls are much more limited, due in part to the limitations of the mobile devi ces we are sending content to. In fact, validation controls can only validate and controls.

Validation controls themselves come in four different flavors:

RangeValidator: Validates that another control's value falls within a certain range.
RegularExpressionValiator: Validates another control's value against a regular expression.
RequiredFieldValidator: Makes sure the user enters a value for a control.
ValidationSummary: Displays a summary of all validation errors that occur on a form. When using the ValidationSummary control, usually a separate form is built to display all the errors.

CREATING ASSEMBLIES WITH ASP.NET

BUILDING HANDLERS IN ASP.NET

INTERFACES AND CLASSES CREATION IN ASP.NET

CACHING IN ASP.NET

CACHING IN ASP.NET PART TWO

WIRE LESS APPLICATION WITH ASP.NET

SECURITY IN ASP.NET PART ONE

SECURITY IN ASP.NET PART TWO

LOCALIZING ASP.NET APPLICATIONS

DEPLOYING ASP.NET APPLICATIONS

ASP.NET CONFIGURATION SYSTEM

WEB SERVICES IN ASP.NET

WEB SERVICES PART TWO

WEB SERVICE INFRASTRUCTURE

WEB SERVICE INFRASTRUCTURE PART TWO

EXCHANGING MESSAGES IN ASP.NET

MICROSOFT HAIL STORM

SOAP AND DOT NET PART ONE

SOAP AND DOT NET PART TWO


No comments:

Post a Comment