oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

Writing Cross-Platform Mobile Applications Using Crossfire

by Wei-Meng Lee, author of .NET Compact Framework Pocket Guide

If you are a Microsoft developer familiar with the .NET Framework, you generally have two options if you want to write mobile applications. For mobile handsets, you can develop mobile web applications using the ASP.NET Mobile controls. For standalone applications, you can use the .NET Compact Framework. However, using the .NET Compact Framework, you can only target Pocket PC devices. And that essentially means that you are out of luck when it comes to developing for competing devices such as Palm and Symbian Smartphones.

A new product from AppForge (, known as Crossfire, promises to close the gap. Using Crossfire, you can leverage on your familiarity with VB.NET (or Visual Basic 6) and write cross-platform mobile applications supporting a wide variety of devices. What that means to a developer is that you now do not need to use the proprietary SDK for each device platform -- you simply maintain one code base and it can then be deployed to multiple platforms.

Device Platforms Supported

Crossfire supports the following platforms:

  • Nokia 6600 Series
  • Palm OS 3.x, 4.x, and 5.x
  • Sony Ericsson P800/P900
  • Pocket PC/Windows Mobile

Figure 1 shows some of the devices that are supported by Crossfire.

Figure 1. The Nokia 6600, palmOne Zire 72, Sony Ericsson P900, and HP iPaq 4150

Crossfire achieves its platform independence through the AppForge's Booster Virtual Machine (previously known as MobileVB). Booster is analogous to the CLR in the .NET Framework. Crossfire applications require the Booster in order to execute. Booster takes up a mere .5MB to 1.3MB of storage space, depending on the target device. On my Zire 72, it has a footprint of .8MB.

Note that only VB.NET and VB6 are supported in Crossfire, and Booster supports most of the commonly used functions in VB.NET.

Familiar Development Environment using Visual Studio .NET 2003

After installing Crossfire, Visual Studio .NET 2003 will add a new Crossfire Application template in the Visual Basic project type (see Figure 2).

Figure 2. The new Crossfire application template

You will then select a platform for which you want to develop (see Figure 3).

Figure 3. Select the target platform

You will see the familiar IDE (see Figure 4).

Figure 4. Using the Visual Studio .NET 2003 IDE to develop a Crossfire application

As in most .NET applications, you drag and drop controls onto the form. Crossfire includes a comprehensive list of controls in the Toolbox (see Figure 5).

Figure 5. The built-in controls of Crossfire (right-click to add more controls)

I have populated my form with some of the built-in controls (see Figure 6). It is identical to developing a .NET Compact Framework application.

Figure 6. Populating the form with AppForge controls

Besides the normal controls that you would expect to see in a mobile application (such as Button, Label, ListBox, etc), Crossfire also includes some interesting controls. Some controls that caught my attention are:

  • Scanner control: You can use the Scanner control to scan barcode (if your device is equipped with a barcode reader).
  • SignatureCapture control: Allows a user to scribble on the surface. You can use this control to capture a user's signature. This control saves the signature as a string (see Figure 7).
  • Camera control: You can use this control on a P800/P900 to control the built-in camera.

Figure 7. Using the SignatureCapture control for user signature

Pages: 1, 2

Next Pagearrow