An Overview of .NET Mobile Development...

This article shall present an overview of some of the issues surrounding development of applications for mobile devices with Microsoft .NET.


By: Chris Sully Date: April 3, 2004

Introduction

This article shall present an overview of some of the issues surrounding development of applications for mobile devices with Microsoft .NET. There are an ever-increasing number of mobile devices in existence that require supporting. Some of these are 'dumber' than a standard PC (e.g. a WAP phone), some 'smarter' (e.g. an ink-enabled tablet PC). Unsurprisingly, given the new business opportunities they expose, Microsoft has made moves to support development for these new platforms.

As per the split between Windows and Web development your applications for these mobile devices can reside on the client device itself (rich client) or on a web server. Of course to have rich server based applications you need big bandwidth, which remains a major issue for mobile applications.

The Microsoft solution to developing for mobile devices focuses on three sets of technologies: VS.NET, the .NET compact framework and ASP.NET mobile controls. Let's consider how these are utilized for different types of application.

Building mobile web applications

All of the .NET Framework is available to mobile web applications with the exception of Windows Forms, as you would expect. For a relatively dumb device you would use mobile web controls within standard web forms delivered to the mobile web browser running on the device OS. For a smarter device you can develop code that targets the .NET Compact Framework which runs on top of the device OS. We'll look at this option in the next section.

Two closely related concepts are key to mobile development:

This allows developers to ignore device specifics as far as possible but also provides the ability to exploit particular capabilities of particular devices.

The adaptive rendering process

Currently over 200 devices are supported. If a new device comes along you need to add a device adapter/ filter that recognizes and represents the capabilities of that device.

If you wish to optimize the display for a particular device, or just change the default output, you can customize for particular devices. To do so you use templates to format the output. These are similar to the templates elsewhere in ASP.NET, i.e. in server controls such as the DataList and DataGrid (header, item, alternatingitem, separator, footer, itemdetails).

.NET Device Programming

ASP.NET mobile controls are intended for applications targeting mobile web browsers. Alternatively your smart device can also utilize the .NET compact framework, a stripped down version of the .NET Framework. This provides the rich client capabilities similar Windows Forms and can be developed using it's own project types under VS.NET.

This you would do on your standard development PC with remote debugging fully enabled via emulators, e.g. pocketPC, Windows CE, smartphone so you can develop enjoying the same rich development environment as you've come to expect from VS.NET. Plus there is additional functionality that comes with the project template such as compilation targeting the particular device and automatic deployment to the device.

You also have a local, stripped down version of SQLServer to utilize, SQLServer Windows CE Edition 2.0. This provides the standard facilities you'll need and, importantly, includes rich replication and synchronization capabilities with full central SQLServer installations, a common requirement of such mobile applications.

Your data access storage architecture can then be implemented according to the nature of the devices, its use and connectivity, i.e. well connected versus occasionally connected. With the latter synchronization via HTTP (replication) is offered via standard SQLServer publication/ subscription facilities.

Comparison of Mobile Application Approaches

Mobile web apps

Smart device apps

Tablet PC (really smart device),

Right at the smart end of the device spectrum comes the tablet PC, with features over and above what you find even on a standard PC, for example:

These additions are provided via a new version of Windows XP: Windows XP Tablet PC Edition.

Key to these extra capabilities is 'Ink' technology, which allows capture of the additional user input data, for example that of hand written text.

Using Ink, data is not simply captured as a bitmap of the signature. This is sensible as considerably more information makes up handwriting than the finished signature, for example, the pressure of the pen, the speed of movement, the different strokes/ movements to create a letter and word.

Ink can serialize the captured data in various forms of various representative powers via the Ink Collector:

Ink can then be converted to a textual representation via controls, which can be hosted in WinForms and IE, and include:

Gestures

A gesture is anything you can do with a pen and their reason for being is similar to that of keyboard shortcuts – they are a quick way of accessing functionality.

There are a set of 14 system gestures which are supported by the OS by default, e.g. tap and double tap. In your applications you can be notified of such events occurring via subscription to the 'SystemGesture' event.

In addition you can select 38 other gestures for which your application can provide support and which are exposed with the 'Gesture' event, e.g. ScratchOut and ScrollUp. Note that Gestures have confidence levels associated with them that you may use in deciding whether to react to a gesture.

Summary

These latest devices offer new business models ripe for exploitation. The devices can be categorized as:

.Net development spans the entire range so as a .NET developer you will already have the skills and much of the knowledge to start developing for these devices.

References

.NET, Mobility and Devices MSDN Webcast
Mike Pelton