Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition [Electronic resources] - نسخه متنی

Andy Wigley; Peter Roxburgh

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید






Testing with a Mobile Phone Emulator

You'll find Internet Explorer an adequate development tool for performing the initial testing of an application's functionality. However, one of the most powerful features of the ASP.NET mobile controls is that they can render your application on different client browsers, each with its own capabilities and possibly even requiring a completely different markup language.

You should test your application on devices that are likely to access it in the real world. You use the mobile Web Forms controls in your applications to carry out some function on a mobile device; however, the actual physical appearance might differ from device to device. Furthermore, the ASP.NET mobile controls allow you to customize your application to introduce device-specific behavior. For example, when you use the mobile Image control, you should supply images appropriate to each browser. In other words, you should supply GIF files for HTML browsers, color JPG or PNG files for advanced WAP browsers, and monochrome WBMP format graphics for older WAP devices. Clearly, it is crucial that you test your application on the different devices that are likely to access it.

Purchasing the actual mobile devices so that you can test your application with mobile clients can be an expensive undertaking. Fortunately, a cheaper option exists: installing software emulators (sometimes called simulators) on your development system. In Chapter 16, we'll look at how to get and use emulators in more detail, but to get you started, in this section we'll show you how to set up the Openwave simulator.


Setting Up the Openwave Simulator


Openwave is the company formed from the merger of Phone.com and Software.com. Phone.com was itself formerly known as Unwired Planet, which was responsible for devising the Handheld Device Markup Language (HDML) for mobile devices, a predecessor of Wireless Markup Language (WML). Many of the world's Internet-enabled phones use Openwave mobile browser software. The ASP.NET mobile controls include support for devices from Alcatel, Motorola, Samsung, Sanyo, Siemens, Panasonic, Casio, Denso, Hitachi, Kyocera, LG, and many others, all of which use the Openwave browser—or its predecessor, the UP.Browser. Openwave has always been a good friend to developers, and many have cut their teeth with WAP development using the Openwave Software Development Kit (SDK). This kit includes a phone simulator, which you can use to test mobile Web applications.

You can download the Openwave SDK free of charge from http://developer.openwave.com/download/indexl. At the time of this writing, Openwave had recently released the Openwave SDK 6.1, which targets developers building applications for devices with XHTML Mobile Profile 1.0 with cascading style sheets (CSS) for the Openwave Mobile Browser 6.1. However, we recommend that you download SDK 4.1.1, which includes a simulator with the UP.Browser V4.1, a WML 1.1 browser included with many devices in current use. ASP.NET mobile controls fully support this browser.

After you install the SDK, click the UP.SDK 4.1.1–UP.Simulator shortcut in the UPSDK411 entry in your Programs or All Programs menu, and you'll see a phone image similar to the one shown in Figure 2-6.


Figure 2-6: The Openwave simulator

The phone image allows you to test mobile applications on a simulated mobile phone that accepts WML 1.1 markup. You can use this instead of or in addition to the integrated Internet Explorer browser.


Using the Simulator for Testing


During development, you can view a mobile Web Forms page in the Openwave simulator by entering the URL of the start page in the Go drop-down box, as shown in Figure 2-7.


Figure 2-7: Testing a mobile Web application with the Openwave simulator

Figure 2-8 shows the functions of the Openwave simulator buttons.


Figure 2-8: Openwave simulator button functions

Actual WAP devices always connect to the Internet via a special proxy, called a WAP gateway. This gateway acts as an important bridge between the wireless WAP protocols used by the phone and the HTTP over TCP/IP used by the wired Web. When you test with a real device, you must configure it to connect via a WAP gateway, operated by your wireless service provider, or in some cases, by your company. Fortunately, the Openwave simulator includes gateway functionality within it, so you don't have to worry about this when testing on your own workstation. The default configuration for the simulator is to connect directly to a server using HTTP protocols over the wired Web. To check that your simulator is configured like this, click the Settings menu of the Openwave simulator and then click UP.Link Settings. Check the HTTP Direct check box, as shown in Figure 2-9.


Figure 2-9: Configure the Openwave simulator for direct HTTP access to your development server

/ 145