Mining Google Web Services: Building Applications with the Google API
An important consideration for this chapter is that Google offers data in response to a request. Handling the input and output is up to you. One of the problems that developers must solve when working with mobile devices is testing for multiple models. Unlike desktop systems, it's not always easy to determine whether an application will provide the correct presentation on a mobile setup. Each mobile device has different capabilities, installed software, and a host of other problem areas for the developer to consider.
Most developers turn to emulation software to help test their applications. An emulator provides the equivalent environment of the mobile device that it's supposed to model. I stress the word equivalent, because most of these emulators don't provide a complete picture of the mobile device environment. You can rely on an emulator to tell you whether the application fits within the screen area that the mobile device provides, but you can't rely on it to tell you about memory issues or whether a particular device has a piece of support software you need. (Some emulators, such as the one provided with Visual Studio .NET, are getting better about testing memory issues ” vendors are aware of many of the emulator issues that developers face and are providing emulator support for these needs.) These other issues require testing on an actual device ”something you should do for at least a subset of the mobile devices you want to support.
Tip | You don't need to buy every mobile device on the market ”emulators can help you keep your costs under control. However, you should buy the devices that people in your organization use most often. Actual device testing is better than using emulators, but you can rely on emulators to help when your application won't be used by a particular mobile device very often. |
The following sections describe four emulation software options. The first option is the built-in support that Visual Studio .NET 2003 provides. If you don't plan to use this IDE, you can skip the first section.
Tip | Keep apprised of the latest Microsoft mobility and embedded system developments at http://msdn.microsoft.com/mobility/. This Web site includes many of the links you'll need to download the latest Microsoft products to make your Google Web Services mobile application development easier. |
I chose these options because they provide a broad range of support, and you can download at least evaluation units of all three emulators. Here are the download locations so that you can get your copies of the products before you begin this section. The following sections assume that you've downloaded the software required for the installation.
-
Microsoft eMbedded Visual Tools 3.0 (2002 edition): http://www.microsoft.com/downloads/details.aspx?FamilyId=F663BF48-31EE-4CBE-AAC5-0AFFD5FB27DD (full development package) or http://www.microsoft.com/downloads/details.aspx?FamilyId=25F4DE97-AE80-477A-9DF1-496B85B3D3E3 (emulators only) or http://www.microsoft.com/downloads/details.aspx?FamilyID=2dbee84a-bd94-4167-b817-2b2e548b2e92 (older full development version)
-
Openwave SDK: http://developer.Openwave.com/download/
-
Smartphone: http://www.yospace.com/spe.html
Visual Studio .NET Built-in Emulator
Visual Studio .NET 2003 comes with a built-in emulator you can use for various kinds of development. When you create a mobile project, the IDE automatically sets up the required emulator support as well. After you develop the application, use the Debug
To use the emulator, simply select the Pocket PC 2002 Emulator (Default) option and click Deploy. The IDE will copy the application to the emulator folder, start the emulator, and load your application. At this point, you can begin testing the application as you would any another .NET application.
The emulator is configurable. Use the Tools
You can change features such as the display size and color depth. More importantly, you can set memory restrictions on the System tab so that the application can model the memory restrictions of the target device to an extent. Note that the default Visual Studio .NET setup has a number of emulators including the Pocket PC and Windows CE devices.
Tip | Microsoft recently released the Visual Basic .NET Resource Kit, a must-have addition for mobile development. The kit offers additional samples and makes it much easier to create robust mobile applications. Learn more about this kit at http://www.microsoft.com/downloads/details.aspx?FamilyId=EF4289B4-FFCB-40BD-9BFE-95256ABD0E13. |
Microsoft eMbedded Visual Tools
The Microsoft eMbedded Visual Tools option is free. All you need to do is download the product and unpack it into an installation directory. You have a choice of two versions on the Internet right now, but the URL at the beginning of this section points to the latest version of the product. Developers have reported fewer problems with the newer version of the emulators and it does model the device more accurately.
Earlier versions of the product create two folders: one named Disk1 and a second named Disk2 . If you have an earlier version of the product, the Disk2 folder contains the three emulators and you can install them individually if desired by using the Setup program found in the individual emulation product folder. For example, if you want to install just the Pocket PC emulation, you can double-click the Setup program in the \Mobile Development Tools\DISK2\PPC12SDK folder. If you're using Visual Studio .NET 2003 or a language such as PHP for development purposes, you only need to install these emulators. You also need the Microsoft Mobile Internet Toolkit ( http://www.microsoft.com/downloads/details.aspx?familyid=ae597f21-b8e4-416e-a28f-b124f41f9768) when you use an older version of Visual Studio .NET. Users of older versions of Visual Studio will need to install the whole package, including the supplied language products.
Note | The older versions of the emulators have a few problems. For example, the handheld PC emulation will sit in the upper left corner of your display and not move. However, it does provide a good environment in which to test your mobile application. Another potential problem with these emulators is that you can only run one of them at a time. Make sure you close an existing emulator before you start a new one. Generally, the new emulator will check for this problem and tell you to close the existing emulator. We'll discuss other emulator issues as the chapter progresses. |
The latest version of Microsoft eMbedded Visual Tools uses a self-extracting executable. When you start the application, it unpacks the contents of the executable into a temporary folder. It then displays a series of dialog boxes that help you install eMbedded Visual Tools 3.0, Microsoft Windows SDK for Pocket PC 2002, and Microsoft Windows SDK for Smartphone 2002. The newer version only includes the Pocket PC and Smartphone emulators ”you can separately download SDKs for the handheld and palm size emulators found in the older version of Microsoft eMbedded Visual Tools at http://msdn.microsoft.com/downloads/list/handheldpc.asp. The Smartphone SDK is only available for eMbedded Visual C++, so make sure you install this language if you want to create a Smartphone application.
When you finish installing everything, it's important to test each of the emulators to ensure you received a good installation. Open one of the sample projects to test the emulator when using the newest version of Microsoft eMbedded Visual Tools. If one of these emulators fails, rerun the setup program and select just that emulator for a reinstall. You need to run each emulator separately when using the older products. If one of the emulators fails to work, you can always uninstall just that emulator using the appropriate entry in the Add/Remove Programs applet. Reinstall the emulator using the required Setup program for that emulator in the Disk2 folder. Figure 9.3 shows a typical Smartphone emulation.
OpenWave SDK
Like the Microsoft emulators, the Openwave SDK is also a free download, but the Open-wave Web site offers plenty of opportunity to purchase products as well. The Openwave file you download is an executable, so double-clicking it starts the installation process. Simply follow the prompts to install the product. Most versions of the product require yes or no answers to each question.
The Openwave Web site offers a number of versions of the product. I suggest you download the latest version of the product to ensure you get the latest features. However, the 5.1 version is also very capable and it includes a number of features not found in the 6.2.2 version used for this chapter. Figure 9.4 shows some of the optional features you can install with the 5.1 version. If you want to use Openwave as your development platform, you might want to download the 5.1 version (or both versions). The 6.2.2 version is most useful as an emulator only.
Once you get Openwave installed and have restarted your machine, you'll want to test this product. If you installed the 6.2.2 version, all you get is the emulator. To start the emulator, select the Start
As previously mentioned, Openwave SDK 5.1 has more to offer than other versions of the product. Unlike some of the other emulators you'll use, this one is actually part of a development IDE. Select the Start
Smartphone
The Smartphone emulator is one of the timed usage options you can try. After you download the product, you can try it for anywhere from 5 to 15 days free (depending on the version you download), at which time your license will expire and the product will cease working. The Smartphone emulator is in a Zip that you download and unpack to a temporary folder. To start the installation process, double-click the setup application that appears in the Zip file (the actual name varies by Smartphone version number). Follow the prompts to install the product.
Now that you have the product installed, you can test it to see if it works. The first time you start this product, you'll see a dialog that requests your licensing details. This dialog box accepts your name, email address, and the key that you were sent in your email. (The company sends this key after you download the product from their Web site.) Make sure you use the information from the email because this step is quite picky.
You also have a choice of starting the product in Development or Display mode. The Development mode opens an IDE you can use to create applications. This mode also shows multiple forms of the emulation, as shown in Figure 9.7. These aren't the only emulators available. The number of emulation options provided surprised me ”they're all available on the Workspace
The Display mode opens a single emulator, as shown in Figure 9.8. Use this option when you want to fine-tune the display details of your application. Most of the emulators have a full view and several zoomed views. Figure 9.8 shows a full view.