The Proper Developer Environments for Mobile PC, Tablet PC, and Ultra-Mobile PC Applications
When Microsoft® Windows® XP Tablet PC Edition appeared in 2002, developers were sometimes confused about whether to write code on a Tablet PC or if it were possible to develop Tablet PC applications on existing desktop computers. The solution turned out to be fairly straightforward, if less than intuitive. However, with the addition of Ultra-Mobile PCs (UMPCs), multiple releases of the Tablet and Touch Technology API, and now the Windows Vista™ operating system, this question arises again: What do you need to do to set up your developer environment and create applications for these form factors?
The Windows Vista SideShow platform will also enable hardware manufacturers to build auxiliary displays in a wide range of peripheral devices such as keyboards, LCD display casings, remote controls, and cell phones.
With the increased profile and importance of mobile PC considerations-network awareness, power management, auxiliary displays, screen resolutions, Tablet and Touch Technology, and others, developing applications for mobile customers has never been more dynamic, exciting, and simultaneously challenging. Your customers are probably using laptops, notebooks, Tablet PCs, Ultra-Mobile PCs, or a combination of these. Do you approach these form factors as devices-requiring emulators-full-fledged Windows computers, or some sort of hybrid? The truth is that it depends. It depends on which version of Windows you’re developing on, which version of Windows you’re developing for, which version of the various SDKs you’re using, and which form factor your applications deploy on. But before you fling your UMPC through a twelfth-story window, take a breath. It’s really not all that complicated, and it’s getting simpler and simpler.
Well, at least the size of the operating system’s footprint. Mobile PC form factors are computers, running the full Windows operating system. I cannot emphasize this enough, because this is the main point of confusion developers run into. Mobile PCs-including Tablet PC and UMPC-run Windows XP or Windows Vista. You develop for them by drawing upon the .NET Framework and Windows API. Mobile PCs are full computers, although they are often confused with Windows Mobile® devices. For Windows Mobile devices, you use the .NET Compact Framework for development and run Windows Embedded on the client.
A quick note: you can find all of the resources mentioned in this article through the Mobile PC Developer Center, the main Microsoft portal for information about developing applications for mobile PCs (http://msdn.microsoft.com).
With Windows Vista, one of the major changes for developers of Tablet PC applications is that the Tablet PC DLLs-and hence the Tablet and Touch Technology-ships as a part of Windows Vista Home Premium, Windows Vista Enterprise, Windows Vista Business, and Windows Vista Ultimate editions. If your development computer has one of these versions installed, there’s no need to download any additional packs. Ink, recognition, and Tablet and Touch Technology are sitting on your computer-even if it is not a Tablet PC-and will just start working when called upon. Likewise for your customers’ computers: if end users are running Windows Vista, all Tablet and Touch Technology is available for those running these premium versions, as well.
To develop your applications, you must install Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components. You’ll find this single download is available on MSDN or through the Windows Vista Developer Center. The Windows Software Development Kit (SDK) includes the necessary materials to develop applications with, among other things:
- The .NET Framework 3.0, including Windows Presentation Foundation (WPF).
- Tablet PC features that enable input, recognition, and rendering of ink.
- User experience guidelines for developers of mobile applications.
- Improved APIs for handling changing network conditions.
- Windows SideShow™
- Ink Analysis (Note: When you add a reference to one of the InkAnalysis namespaces, you must also register the corresponding DLL in the GAC. You can either do so manually or also add a reference to IALoad.dll, which handles registration for you.)
- Data synchronization so that customers have the most current information in the least obtrusive manner.
- Network awareness APIs to handle connected/disconnected scenarios.
- Power management functions to keep batteries operating for the maximum amount of time.
- Many samples.
- Connections to communities from which you can get answers to solve even the most troublesome bugs.
The Windows SDK enables you to decide which programming model you want to use. Windows Forms (either COM or managed) and WPF are available for you to use in your Tablet PC and mobile PC applications. In addition to the documentation available for each of these, the SDK loads samples into “C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\TabletPC” directory.
The Windows SDK installs the following header files that pertain to Tablet and Touch Technology. These are saved by default in “C:\Program Files\Microsoft SDKs\Windows\v6.0\Include”.
- msinkaut.h contains the core ink capabilities for COM.
- IACOM.h contains the InkAnalysis functionality for the COM layer.
- RTSCOM.h contains the RealTimeStylus and StylusPlugin calls for COM.
.NET Framework Windows Forms
The Windows SDK installs all the managed DLLs for Tablet and Touch Technology, which include the following namespaces that contain Tablet and Touch Technology APIs. (Don’t forget using or imports statements in your applications):
- Microsoft.Ink. This namespace contains APIs that implement digital ink on the Tablet PC and was the original managed namespace from the first release of the Tablet PC API. This has all of the managed elements for ink, recognition, rendering, and persisting ink. Additionally, starting with Windows Vista, the managed layer of the InkAnalysis API resides in this namespace. InkAnalysis gives developers the ability to parse free-form ink into words, lines, paragraphs, bullets, and other meaningful data.
- Microsoft.Ink.TextInput. New in Windows Vista, this namespace contains the APIs exposed by Tablet PC Input Panel.
- Microsoft.StylusInput. This namespace contains APIs that handles the stylus packet data from a digitizer in real time. It has become known as the RealTimeStylus API because of the major object in the namespace.
- Microsoft.StylusInput.PluginData. This namespace contains the data passed to RealTimeStylus plug-ins.
Windows Presentation Foundation
Windows Presentation Foundation (WPF) provides the basis for building applications and high fidelity experiences in Windows Vista, blending together application UI, documents, and media content, while exploiting the full power of your computer. The functionality extends to the support for Tablet PC, UMPC, and other forms of input, a more modern imaging and printing pipeline, accessibility and UI automation infrastructure, data-driven UI and visualization, as well as the integration points for weaving the application experience into the Windows shell.
Overly dense content is difficult to read quickly in mobile situations, and a dense user interface layer requires a great degree of user attention.
You can also use the following namespaces that are directly designed to be used with WPF.
- System.Windows.Controls. Use the InkCanvas control, an element in this namespace, to receive and display ink input. Generally done through a stylus, though you can also use a mouse with a digitizer to produce ink strokes. The created strokes are represented as Stroke objects, and can be manipulated programmatically and by user input. If you only need to render ink onto a surface (rather than recognize or parse the ink) the InkPresenter control renders ink on a surface.
- System.Windows.Ink. Provides classes to interact with and manipulate ink on the Windows Presentation Foundation (WPF) platform.
- System.Windows.Input. Contains a lot of classes that provide access to the stylus, gestures, and other important classes related to ink and commands.
- System.Windows.Input.StylusPlugIns. Provides classes that support manipulating data from a tablet pen in WPF. Essentially, this is the WPF version of the StylusInput managed API.
With the various layers available, you can decide which platform is best suited for your mobile PC needs. You can use WPF for applications deployed on computers running Windows Vista, but WPF is also backward-compatible on computers running Windows XP. One development hitch is ensuring that you use the correct version of InkAnalysis or StylusPlugin APIs, as there are three of each-COM, managed, and WPF.
By: Eliot Graff
Eliot Graff is the Lead for the Developer Experience Team within the Mobile and Tailored Platforms Division at Microsoft. He started programming in the late 70s, using punch cards and FORTRAN to solve biomedical engineering problems. A former English professor (obviously not very good at FORTRAN), he mostly spends his time chasing his two children and recuperating with his wife. His latest hobbies given to him by his children include dinosaurs, Spiderman, and hip-hop.
The Recognizer Pack provides ten handwriting-recognition engine languages.